Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install flake8 mypy pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Type check with mypy
run: |
mypy lunardate.py
- name: Test with pytest
run: |
python lunardate.py -v
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
[![PyPI - Version](https://img.shields.io/pypi/v/lunardate)](https://pypi.org/project/lunardate/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/lunardate)](https://pypistats.org/packages/lunardate)


Chinese Calendar: http://en.wikipedia.org/wiki/Chinese_calendar
Chinese Calendar: <http://en.wikipedia.org/wiki/Chinese_calendar>

## Install

Expand All @@ -17,17 +16,17 @@ pip install lunardate

```
>>> from lunardate import LunarDate
>>> LunarDate.fromSolarDate(1976, 10, 1)
>>> LunarDate.from_solar_date(1976, 10, 1)
LunarDate(1976, 8, 8, 1)
>>> LunarDate(1976, 8, 8, 1).toSolarDate()
>>> LunarDate(1976, 8, 8, 1).to_solar_date()
datetime.date(1976, 10, 1)
>>> LunarDate(1976, 8, 8, 1).year
1976
>>> LunarDate(1976, 8, 8, 1).month
8
>>> LunarDate(1976, 8, 8, 1).day
8
>>> LunarDate(1976, 8, 8, 1).isLeapMonth
>>> LunarDate(1976, 8, 8, 1).is_leap_month
True

>>> today = LunarDate.today()
Expand Down Expand Up @@ -68,9 +67,9 @@ pip install lunardate
>>> LunarDate.today() == LunarDate.today()
True

>>> LunarDate.leapMonthForYear(2023)
>>> LunarDate.leap_month_for_year(2023)
2
>>> LunarDate.leapMonthForYear(2022)
>>> LunarDate.leap_month_for_year(2022)
None
```

Expand All @@ -89,7 +88,7 @@ this library can only deal with year from 1900 to 2099 (in chinese calendar).

## See also

* lunar: http://packages.qa.debian.org/l/lunar.html,
* lunar: <http://packages.qa.debian.org/l/lunar.html>,
A converter written in C, this program is derived from it.
* python-lunar: http://code.google.com/p/liblunar/
* python-lunar: <http://code.google.com/p/liblunar/>
Another library written in C, including a python binding.
25 changes: 16 additions & 9 deletions lunardate.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Metadata-Version: 2.1
Metadata-Version: 2.4
Name: lunardate
Version: 0.2.2
Summary: A Chinese Calendar Library in Pure Python
Expand All @@ -7,18 +7,26 @@ Author: LI Daobing
Author-email: lidaobing@gmail.com
License: GPLv3
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
License-File: LICENSE.txt
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary


A Chinese Calendar Library in Pure Python
Expand Down Expand Up @@ -108,8 +116,7 @@ Usage

>>> LunarDate.leapMonthForYear(2023)
2
>>> LunarDate.leapMonthForYear(2022)
None
>>> LunarDate.leapMonthForYear(2022) # will return None

Limits
------
Expand Down
Loading
Loading