{ "info": { "author": "wolfhong", "author_email": "hongxucai1991@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "LunarCalendar: A Lunar-Solar Converter\n======================================\n\n.. image::\n https://img.shields.io/pypi/v/LunarCalendar.svg\n :target: https://pypi.python.org/pypi/LunarCalendar\n :alt: Last stable version (PyPI)\n\n.. image::\n https://travis-ci.org/wolfhong/LunarCalendar.svg\n :target: https://travis-ci.org/wolfhong/LunarCalendar\n :alt: build status\n\n\nOverview\n--------\n\n`Chinese version(\u4e2d\u6587\u7248) `_ is provided.\n\nLunarCalendar is a Lunar-Solar Converter, containing a number of lunar and solar festivals in China.\n\nKorean, Japanese or Vietnamese lunar calendar is the same as Chinese calendar, but has different festivals.\nKorean, Japanese and Vietnamese festivals can be easily included, with their languages.\n\nLunarCalendar supports a time range of 1900 to 2100, which may be enough for a long time.\nBut if you have needs for a wider time range, you can use ``generate.html`` to extend it.\n\nLunarCalendar is inspired by `Lunar-Solar-Calendar-Converter `_.\n\n\nFeatures\n--------\n\n* Accurate raw data, synchronize with Microsolf's ``ChineseLunisolarCalendar`` class\n* Easy to extend festivals and languages, supported both ``zh_hans`` and ``zh_hant``\n* Included Lunar Festivals, such as: MidAutumn Festival, Chinese New Year Eve, DragonBoat Festivals\n* Included Solar Festivals without fixed dates, such as: Mother's Day, Easter\n* Added legality check of the lunar and solar date\n* Supported 24 solar terms(\u7acb\u6625/\u6625\u5206/\u6e05\u660e/\u51ac\u81f3\u7b49)\n\n\nInstall\n-------\n\nLunarCalendar can be installed from the PyPI with ``easy_install``::\n\n $ easy_install LunarCalendar\n\nOr pip::\n\n $ pip install LunarCalendar\n\nIf you encounter an error like ``command 'gcc' failed with exit status 1 while installing ephem``, maybe you should install ``python-devel`` first.\nFor CentOS::\n\n $ yum install python-devel\n\nFor Ubuntu::\n\n $ apt-get install python-dev\n\n\nConsole Commands\n----------------\n\nA console command called ``lunar-find`` can be used to find the date of the festival, using it's chinese name.\nDefault to this year. Supporting alias of the festival.\n\n.. code-block:: console\n\n $ lunar-find \u91cd\u9633\n \u91cd\u9633\u8282 on 2018: 2018-10-17\n\n $ lunar-find \u91cd\u967d\u7bc0\n \u91cd\u9633\u8282 on 2018: 2018-10-17\n\n $ lunar-find \u767b\u9ad8\u8282 2019\n \u91cd\u9633\u8282 on 2019: 2019-10-07\n\nYou can also print all included festivals or 24 solar terms by date asc with:\n\n.. code-block:: console\n\n $ lunar-find all 2019\n $ lunar-find festival 2012\n $ lunar-find \u8282\u65e5 2012\n $ lunar-find solarterm\n $ lunar-find \u8282\u6c14\n\n\nQuickstart\n----------\n\nSolar to Lunar:\n\n.. code-block:: python\n\n import datetime\n from lunarcalendar import Converter, Solar, Lunar, DateNotExist\n\n solar = Solar(2018, 1, 1)\n print(solar)\n lunar = Converter.Solar2Lunar(solar)\n print(lunar)\n solar = Converter.Lunar2Solar(lunar)\n print(solar)\n print(solar.to_date(), type(solar.to_date()))\n\nLunar to Solar:\n\n.. code-block:: python\n\n lunar = Lunar(2018, 2, 30, isleap=False)\n print(lunar)\n solar = Converter.Lunar2Solar(lunar)\n print(solar)\n lunar = Converter.Solar2Lunar(solar)\n print(lunar)\n print(lunar.to_date(), type(lunar.to_date()))\n print(Lunar.from_date(datetime.date(2018, 4, 15)))\n\nLegality check for solar and lunar date. 2018-2-15(Leap Month) does not exist, but 2012-4-4(Leap Month) exists:\n\n.. code-block:: python\n\n Lunar(2012, 4, 4, isleap=True) # date(2012, 5, 24)\n try:\n lunar = Lunar(2018, 2, 15, isleap=True)\n except DateNotExist:\n print(traceback.format_exc())\n\nPrint all the festivals included, with Chinese and English. Other languages are welcome to extend(Fork & Pull Request).\n\n.. code-block:: python\n\n from lunarcalendar.festival import festivals\n\n # print festivals, using English or Chinese\n print(\"----- print all festivals on 2018 in chinese: -----\")\n for fest in festivals:\n print(fest.get_lang('zh'), fest(2018))\n\n print(\"----- print all festivals on 2017 in english: -----\")\n for fest in festivals:\n print(fest.get_lang('en'), fest(2017))\n\nOutput:\n\n.. code-block:: shell\n\n ......\n \u6bcd\u4eb2\u8282 2018-05-13\n \u7236\u4eb2\u8282 2018-06-17\n \u4e2d\u79cb\u8282 2018-09-24\n \u611f\u6069\u8282 2018-11-22\n \u91cd\u9633\u8282 2018-10-17\n \u6625\u8282 2018-02-16\n \u4e2d\u5143\u8282 2018-08-25\n \u4e03\u5915\u8282 2018-08-17\n \u814a\u516b\u8282 2019-01-13\n \u6e05\u660e\u8282 2018-04-05\n \u9664\u5915 2019-02-04\n \u5bd2\u8863\u8282 2018-11-08\n \u5143\u5bb5\u8282 2018-03-02\n \u9f99\u62ac\u5934 2018-03-18\n \u7aef\u5348\u8282 2018-06-18\n ......\n\n\nContribution\n------------\n\nIncluding festival standards:\n\n* Common festivals in the the country, such as: Christmas, Halloween, etc.\n* Lunar festivals.\n* Solar festivals without fixed dates, such as: Mother's Day, Easter, etc.\n\nSupporting Chinese and English only now. If you want to add Korean, Japanese or Vietnamese supports, modify ``lunarcalendar/festival.py`` to add festivals and languages.\n\nSome unusual festivals may not be included, `welcome to extend `_.\n\n\n\nAbout\n-----\n\n* `Homepage `_\n* `PyPI `_\n* `Issue tracker `_\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wolfhong/LunarCalendar", "keywords": "lunar calendar,festival,Chinese festivals,24 solar terms,solar calendar,lunar solar converter,lunisolar calendar", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "LunarCalendar", "package_url": "https://pypi.org/project/LunarCalendar/", "platform": "", "project_url": "https://pypi.org/project/LunarCalendar/", "project_urls": { "Homepage": "https://github.com/wolfhong/LunarCalendar" }, "release_url": "https://pypi.org/project/LunarCalendar/0.0.9/", "requires_dist": [ "python-dateutil (>=2.6.1)", "ephem (>=3.7.5.3)", "pytz" ], "requires_python": ">=2.7, <4", "summary": "A lunar calendar converter, including a number of lunar and solar holidays, mainly from China.", "version": "0.0.9" }, "last_serial": 3957439, "releases": { "0.0.7": [ { "comment_text": "", "digests": { "md5": "5bc898b1777ac022f52e764d56db5cd1", "sha256": "6eb2e36a736e697cee476a8394ee306f36a8f2766d85d8f023ca31922a9c5611" }, "downloads": -1, "filename": "LunarCalendar-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5bc898b1777ac022f52e764d56db5cd1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 11352, "upload_time": "2018-05-28T08:44:49", "url": "https://files.pythonhosted.org/packages/9e/f3/f898419f3b47484261cf004b3253ed9997f1b08078d495ea243de83eca1d/LunarCalendar-0.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7d5d1058eb92e0d299a4d3f0126c67d0", "sha256": "94f91d42e8b1300787f0a807041b5c8612443070248a670236a992042a73753f" }, "downloads": -1, "filename": "LunarCalendar-0.0.7.tar.gz", "has_sig": false, "md5_digest": "7d5d1058eb92e0d299a4d3f0126c67d0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <4", "size": 11229, "upload_time": "2018-05-28T08:44:51", "url": "https://files.pythonhosted.org/packages/25/b8/c5f77c0970efa20611d2df869bab2b18c81f5829a9ad6cfe0660ee27f294/LunarCalendar-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "9ba85384a0505dd19e752299b71d9512", "sha256": "8dbc6b5e5b7320c8fb6d2098d54a901625545012d6f30d0610ae88f8685905f6" }, "downloads": -1, "filename": "LunarCalendar-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9ba85384a0505dd19e752299b71d9512", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 18048, "upload_time": "2018-05-29T16:54:17", "url": "https://files.pythonhosted.org/packages/ec/86/eb4834ba58cb5a864098c303942a2e077fac967572e1f887f480b08ddae7/LunarCalendar-0.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce1b47c61abcf999613f3e571b39d6af", "sha256": "7699ba36cb7de811afedf01af97540691634d1ff904e3818a3c179e4dc511d46" }, "downloads": -1, "filename": "LunarCalendar-0.0.8.tar.gz", "has_sig": false, "md5_digest": "ce1b47c61abcf999613f3e571b39d6af", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <4", "size": 17382, "upload_time": "2018-05-29T16:54:18", "url": "https://files.pythonhosted.org/packages/72/ba/4975ed15f30b936d81bbb3357e4c10c5b99f778548965d09fb1c2a1953d7/LunarCalendar-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "2798af0411132ce12c6543bff6a0dd43", "sha256": "5ef25883d73898b37edb54da9e0f04215aaa68b897fd12e9d4b79756ff91c8cb" }, "downloads": -1, "filename": "LunarCalendar-0.0.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2798af0411132ce12c6543bff6a0dd43", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 18280, "upload_time": "2018-06-13T12:01:21", "url": "https://files.pythonhosted.org/packages/ab/e0/a52ffc02395474858552ca6437226e23ad67e25fd85cb387f02e479cfe01/LunarCalendar-0.0.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee3faced40d85637f00ce47cf4a554b6", "sha256": "681142f22fc353c3abca4b25699e3d1aa7083ad1c268dce36ba297eca04bed5a" }, "downloads": -1, "filename": "LunarCalendar-0.0.9.tar.gz", "has_sig": false, "md5_digest": "ee3faced40d85637f00ce47cf4a554b6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <4", "size": 18019, "upload_time": "2018-06-13T12:01:22", "url": "https://files.pythonhosted.org/packages/01/eb/5900632e13fa5ae7fd10127d59b3809f4586484b69c9603e624b570ccbfb/LunarCalendar-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2798af0411132ce12c6543bff6a0dd43", "sha256": "5ef25883d73898b37edb54da9e0f04215aaa68b897fd12e9d4b79756ff91c8cb" }, "downloads": -1, "filename": "LunarCalendar-0.0.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2798af0411132ce12c6543bff6a0dd43", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, <4", "size": 18280, "upload_time": "2018-06-13T12:01:21", "url": "https://files.pythonhosted.org/packages/ab/e0/a52ffc02395474858552ca6437226e23ad67e25fd85cb387f02e479cfe01/LunarCalendar-0.0.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee3faced40d85637f00ce47cf4a554b6", "sha256": "681142f22fc353c3abca4b25699e3d1aa7083ad1c268dce36ba297eca04bed5a" }, "downloads": -1, "filename": "LunarCalendar-0.0.9.tar.gz", "has_sig": false, "md5_digest": "ee3faced40d85637f00ce47cf4a554b6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <4", "size": 18019, "upload_time": "2018-06-13T12:01:22", "url": "https://files.pythonhosted.org/packages/01/eb/5900632e13fa5ae7fd10127d59b3809f4586484b69c9603e624b570ccbfb/LunarCalendar-0.0.9.tar.gz" } ] }