From 0cb357c525072d3cbdf3b86d54261a4d6180c191 Mon Sep 17 00:00:00 2001 From: LI Daobing Date: Sun, 3 Dec 2023 14:50:51 +0800 Subject: [PATCH] release 0.2.1 --- README.md | 1 + lunardate.egg-info/PKG-INFO | 211 +++++++++++++++++---------------- lunardate.egg-info/SOURCES.txt | 1 + lunardate.py | 2 +- 4 files changed, 112 insertions(+), 103 deletions(-) diff --git a/README.md b/README.md index 40dafdb..05353c2 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ pip install lunardate ## News +* 0.2.1: fix bug in year 1956 * 0.2.0: extend year to 2099, thanks to @FuGangqiang * 0.1.5: fix bug in `==` * 0.1.4: support '+', '-' and compare, fix bug in year 2050 diff --git a/lunardate.egg-info/PKG-INFO b/lunardate.egg-info/PKG-INFO index 3e8754a..b75c1b7 100644 --- a/lunardate.egg-info/PKG-INFO +++ b/lunardate.egg-info/PKG-INFO @@ -1,113 +1,120 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: lunardate -Version: 0.2.0 +Version: 0.2.1 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 -Description: - 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 - - 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. - -Platform: UNKNOWN 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: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development :: Libraries :: Python Modules +License-File: LICENSE.txt + + +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 + +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.egg-info/SOURCES.txt b/lunardate.egg-info/SOURCES.txt index 7877860..b37ab12 100644 --- a/lunardate.egg-info/SOURCES.txt +++ b/lunardate.egg-info/SOURCES.txt @@ -1,3 +1,4 @@ +LICENSE.txt README.md lunardate.py setup.py diff --git a/lunardate.py b/lunardate.py index 9abdfa5..c9cfbbc 100644 --- a/lunardate.py +++ b/lunardate.py @@ -108,7 +108,7 @@ import datetime -__version__ = "0.2.0" +__version__ = "0.2.1" __all__ = ['LunarDate'] class LunarDate(object):