A Chinese Calendar Library in Pure Python
Project description
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 datetime.timedelta(-11444) >>> ld-td LunarDate(1976, 7, 27, 0) >>> sd-ld datetime.timedelta(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
News
0.1.4: support ‘+’, ‘-’ and compare, fix bug in year 2050
0.1.3: support python 3.0
Limits
this library can only deal with year from 1900 to 2049 (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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lunardate-0.1.4.tar.gz.
File metadata
- Download URL: lunardate-0.1.4.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02b3e08500f48bf6a5c58f8750ccda2e5e3f71ac2e26adb115dafd9ab7bfe4f8
|
|
| MD5 |
4cd256b6ecb280e719ec271fad632dc7
|
|
| BLAKE2b-256 |
ab5e5d888c7b20ca7af33c69de5d9c512a40822b14380ea488370b131cd2c9ae
|
File details
Details for the file lunardate-0.1.4-py2.6.egg.
File metadata
- Download URL: lunardate-0.1.4-py2.6.egg
- Upload date:
- Size: 8.9 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b33aa5b98f63e188f8de91062133c947c5f906a8c6d74ca8ed2dcb8699383349
|
|
| MD5 |
2e89bc077185209a3932ea541010cc4e
|
|
| BLAKE2b-256 |
6e620b23f3951f64bb17bb3ea0325662629c60c0866606c88ccfdb71e979c3da
|
File details
Details for the file lunardate-0.1.4-py2.5.egg.
File metadata
- Download URL: lunardate-0.1.4-py2.5.egg
- Upload date:
- Size: 8.9 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
586592aa1237ad555778e92f2d7f5866e87ead1c8b0bc232d66da2708ee035a0
|
|
| MD5 |
2bbec96a42301c9baa7d2823c6b8996a
|
|
| BLAKE2b-256 |
157a4dd81f6ab7b863516dcff3c897cdc3f9af1ef808e040c68b6d2de76bad2c
|