diff --git a/.gitignore b/.gitignore index f72f665..c519b0d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.swp build dist +lunardate.egg-info/PKG-INFO diff --git a/README.md b/README.md index 68ff0a8..0cedeb7 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ pip install lunardate ## News +* 0.3.0: drop python 2, add typing hints, rename identifiers to follow PEP 8 * 0.2.2: add LunarDate.leapMonthForYear; fix bug in year 1899 * 0.2.1: fix bug in year 1956 * 0.2.0: extend year to 2099, thanks to @FuGangqiang diff --git a/lunardate.egg-info/PKG-INFO b/lunardate.egg-info/PKG-INFO deleted file mode 100644 index 09c28a6..0000000 --- a/lunardate.egg-info/PKG-INFO +++ /dev/null @@ -1,132 +0,0 @@ -Metadata-Version: 2.4 -Name: lunardate -Version: 0.2.2 -Summary: A Chinese Calendar Library in Pure Python -Home-page: https://github.com/lidaobing/python-lunardate -Author: LI Daobing -Author-email: lidaobing@gmail.com -License: GPLv3 -Classifier: Development Status :: 4 - Beta -Classifier: Programming Language :: Python :: 3 -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 -========================================= - -Chinese Calendar: http://en.wikipedia.org/wiki/Chinese_calendar - -Usage ------ - >>> LunarDate.fromSolarDate(1976, 10, 1) - LunarDate(1976, 8, 8, 1) - >>> LunarDate(1976, 8, 8, 1).toSolarDate() - 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 - True - - >>> today = LunarDate.today() - >>> type(today).__name__ - 'LunarDate' - - >>> # support '+' and '-' between datetime.date and datetime.timedelta - >>> ld = LunarDate(1976,8,8) - >>> sd = datetime.date(2008,1,1) - >>> td = datetime.timedelta(days=10) - >>> ld-ld - datetime.timedelta(0) - >>> (ld-sd).days - -11444 - >>> ld-td - LunarDate(1976, 7, 27, 0) - >>> (sd-ld).days - 11444 - >>> ld+td - LunarDate(1976, 8, 18, 0) - >>> td+ld - LunarDate(1976, 8, 18, 0) - >>> ld2 = LunarDate.today() - >>> ld < ld2 - True - >>> ld <= ld2 - True - >>> ld > ld2 - False - >>> ld >= ld2 - False - >>> ld == ld2 - False - >>> ld != ld2 - True - >>> ld == ld - True - >>> LunarDate.today() == LunarDate.today() - True - >>> before_leap_month = LunarDate.fromSolarDate(2088, 5, 17) - >>> before_leap_month.year - 2088 - >>> before_leap_month.month - 4 - >>> before_leap_month.day - 27 - >>> before_leap_month.isLeapMonth - False - >>> leap_month = LunarDate.fromSolarDate(2088, 6, 17) - >>> leap_month.year - 2088 - >>> leap_month.month - 4 - >>> leap_month.day - 28 - >>> leap_month.isLeapMonth - True - >>> after_leap_month = LunarDate.fromSolarDate(2088, 7, 17) - >>> after_leap_month.year - 2088 - >>> after_leap_month.month - 5 - >>> after_leap_month.day - 29 - >>> after_leap_month.isLeapMonth - False - - >>> LunarDate.leapMonthForYear(2023) - 2 - >>> LunarDate.leapMonthForYear(2022) # will return None - -Limits ------- - -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, - A converter written in C, this program is derived from it. -* python-lunar: http://code.google.com/p/liblunar/ - Another library written in C, including a python binding. diff --git a/lunardate.py b/lunardate.py index c79681a..0ed5540 100644 --- a/lunardate.py +++ b/lunardate.py @@ -116,7 +116,7 @@ import warnings from typing import ClassVar, Iterator, Optional, Union, overload -__version__ = "0.2.2" +__version__ = "0.3.0" __all__ = ['LunarDate'] class LunarDate: diff --git a/setup.py b/setup.py index d043b5a..d7f4ee8 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ author = 'LI Daobing', author_email = 'lidaobing@gmail.com', url = 'https://github.com/lidaobing/python-lunardate', - license = 'GPLv3', + license = 'GPL-3.0-or-later', python_requires='>=3.7', classifiers = [ 'Development Status :: 4 - Beta', @@ -22,7 +22,6 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', - 'License :: OSI Approved :: GNU General Public License (GPL)', 'Operating System :: OS Independent', 'Topic :: Software Development :: Libraries :: Python Modules' ]