{ "info": { "author": "Lee Wei Yen", "author_email": "lee@weiyen.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Sociology", "Topic :: Software Development :: Internationalization", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "Lunisolar\n=========\n\nLunisolar is a Python package for handling Chinese calendars. Lunisolar contains a set of helper functions designed to make it easy to convert between the Gregorian (Western) calendar and the Chinese calendar.\n\nBased on the works of `Helmer Aslaksen`_. Built on top of `PyCalCal`_, the Python implementation of Calendrica 3.0, a set of calendar-related algorithms as described in `Dershowitz and Reingold\u2019s book \u201cCalendrical Calculations\u201d `_.\n\nUsage\n-----\nInitializing a Chinese date::\n\n >>> from lunisolar import ChineseDate\n >>> mid_autumn = ChineseDate.from_chinese(chinese_year=2013, \n chinese_month=8, \n chinese_day=15, \n is_leap_month=False)\n >>> mid_autumn\n chinese_date(year=2013, month=8, day=15, is_leap_month=False)\n >>> mid_autumn.gregorian_date\n datetime.date(2013, 9, 19)\n\nA Chinese date object can be initialized from a Gregorian (western) date::\n\n >>> from lunisolar import ChineseDate\n >>> moon_landing = ChineseDate.from_gregorian(1969, 7, 20)\n >>> moon_landing\n chinese_date(year=1969, month=6, day=7, is_leap_month=False)\n\nThe ChineseDate class shares the same constructors as datetime.date::\n\n >>> ChineseDate.today()\n chinese_date(year=2012, month=12, day=29, is_leap_month=False)\n\n >>> timestamp = 1360414893.724195\n >>> ChineseDate.fromtimestamp(timestamp)\n chinese_date(year=2012, month=12, day=29, is_leap_month=False)\n \n >>> ordinal = 734908\n >>> ChineseDate.fromordinal(ordinal)\n chinese_date(year=2012, month=12, day=29, is_leap_month=False)\n\n\nRetrieving properties of the Chinese calendar::\n\n >>> moon_landing = ChineseDate.from_gregorian(1969, 7, 20)\n >>> moon_landing.year\n 1969\n >>> moon_landing.month\n 6\n >>> moon_landing.day\n 7\n >>> moon_landing.is_leap_month\n False\n >>> moon_landing.zodiac\n rooster\n >>> moon_landing.element\n earth\n >>> moon_landing.heavenly_stem\n ji\n >>> moon_landing.earthly_branch\n you\n\nThe add, subtract, and comparison operators for `ChineseDate` is similar to that of the `datetime.date` object. For subtraction and comparison, ChineseDate and datetime.date can be used interchangeably.\n\n::\n\n >>> from datetime import timedelta\n >>> cdate = ChineseDate.from_gregorian(1969, 7, 20)\n >>> gdate = datetime.date(2013, 2, 10)\n >>> cdate > gdate\n False\n >>> gdate - cdate\n datetime.timedelta(15911)\n >>> diff = timedelta(200)\n >>> cdate + diff\n chinese_date(year=1969, month=12, day=29, is_leap_month=False)\n\n.. _`Helmer Aslaksen`: http://www.math.nus.edu.sg/aslaksen/calendar/chinese.shtml\n \n.. _pycalcal: https://github.com/espinielli/pycalcal", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yen223/lunisolar", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "lunisolar", "package_url": "https://pypi.org/project/lunisolar/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lunisolar/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/yen223/lunisolar" }, "release_url": "https://pypi.org/project/lunisolar/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "A library to handle the Chinese calendar", "version": "0.1.3" }, "last_serial": 794399, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "f409a42aab6902248e3e258637bd2749", "sha256": "f6a27332373b0c3a2472ef9b5cf21f5d67dbdf8d3ce10cefab2e5180235c6dc3" }, "downloads": -1, "filename": "lunisolar-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f409a42aab6902248e3e258637bd2749", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48708, "upload_time": "2013-02-12T08:50:02", "url": "https://files.pythonhosted.org/packages/a1/8a/83ab5e9804c8869acd23c3b9ed43888f15ac84fc0b72106d734af602923d/lunisolar-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "014c0726b492126b29fd215649179e31", "sha256": "11be2162910e341749c0f93151ee1a3bbe2a850c1da1e46af1e762ee348e20f4" }, "downloads": -1, "filename": "lunisolar-0.1.3.tar.gz", "has_sig": false, "md5_digest": "014c0726b492126b29fd215649179e31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48749, "upload_time": "2013-02-12T11:58:05", "url": "https://files.pythonhosted.org/packages/77/ca/b2bb9d44593e3c2dcac9a36f942f28718914c224709f1c52639e85ccda50/lunisolar-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "014c0726b492126b29fd215649179e31", "sha256": "11be2162910e341749c0f93151ee1a3bbe2a850c1da1e46af1e762ee348e20f4" }, "downloads": -1, "filename": "lunisolar-0.1.3.tar.gz", "has_sig": false, "md5_digest": "014c0726b492126b29fd215649179e31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48749, "upload_time": "2013-02-12T11:58:05", "url": "https://files.pythonhosted.org/packages/77/ca/b2bb9d44593e3c2dcac9a36f942f28718914c224709f1c52639e85ccda50/lunisolar-0.1.3.tar.gz" } ] }