{ "info": { "author": "david.schenck@outlook.com", "author_email": "david.schenck@outlook.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Gregorian\nGregorian provides a `Calendar` class to manage custom calendars.\n\n## Installation\nThe best - and easiest - way to install `Gregorian` is by calling:\n```python\npip install gregorian \n```\n\n## Usage\n```python\nimport datetime\nfrom gregorian import Calendar, utils\n\n#every day in 2019\ncalendar = Calendar.generate(datetime.date(2019,1,1), periods=365, freq=\"D\")\n\n#weekends\nweekends = calendar.weekends()\n\n#week days\nweekdays = calendar.weekdays()\n\n#first and last date\nweekdays.first(), weekdays.last()\n\n#or slice\nweekdays[0], weekdays[-1]\n\n#10th weekday each month\nb10 = weekdays.groupby(\"month\").apply(lambda cal: cal[10])\n\n#5th to 10th weekday each month\nb5to10 = weekdays.groupby(\"month\").apply(lambda cal: cal[5:10])\n\n#set-like operations\nholidays = [\n datetime.date(2019, 1, 1), datetime.date(2019, 1, 21), \n datetime.date(2019, 2, 18), datetime.date(2019, 5, 27),\n datetime.date(2019, 7, 4), datetime.date(2019, 9, 2), \n datetime.date(2019, 10, 14), datetime.date(2019, 11, 11), \n datetime.date(2019, 11, 28), datetime.date(2019, 12, 25)\n]\n\n#business days\nworkdays = weekdays.intersection(holidays)\n\n#... alternatively\nworkdays = holidays.inverse(datetime.date(2019, 1, 1), datetime.date(2019, 12, 31)).weekdays()\n\n#non-weekend holidays\noffdays = weekdays.union(holidays)\n\n#is my birthday a weekday?\ndatetime.date(2019, 6, 17) in weekdays\n>> True\n\n#summer workdays\nsummer = workdays[datetime.date(2019,6,21):datetime.date(2019,9,20)]\n\n#index of given date in given frequency\nworkdays.dayof(datetime.date(2019,8,14), \"month\")\n>> 8\n\n#a few utilities\nutils.isleap(2016), utils.isleap(datetime.date(2019,6,17))\n>> True, False\n\n#end of month\nutils.eom(datetime.date(2016,2,14), 0), utils.eom(datetime.date(2016,2,14), -1)\n>> datetime.date(2019, 2, 29), datetime.date(2019, 1, 31)\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dschenck/gregorian", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "gregorian", "package_url": "https://pypi.org/project/gregorian/", "platform": "", "project_url": "https://pypi.org/project/gregorian/", "project_urls": { "Homepage": "https://github.com/dschenck/gregorian" }, "release_url": "https://pypi.org/project/gregorian/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "A calendar wrapper", "version": "0.0.2" }, "last_serial": 5726478, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "9c3e3e451903bb9f727628a3ab1d6227", "sha256": "6e2f8424d73876f98871694bca9e8dc0e93d250076aee6d22dfc6733956948f1" }, "downloads": -1, "filename": "gregorian-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9c3e3e451903bb9f727628a3ab1d6227", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5914, "upload_time": "2019-08-14T21:40:21", "url": "https://files.pythonhosted.org/packages/80/34/e60f8b0cfa5e9de53a611fd98ad08e68111675bf8674c16852f901cbd692/gregorian-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "777fdbde5a1209c2c43d9df0d160ae2e", "sha256": "26623ed9606cd7fb520d6dc0740690c0ea7f5f0b358b426b8d80e6be7088b0cb" }, "downloads": -1, "filename": "gregorian-0.0.1.tar.gz", "has_sig": false, "md5_digest": "777fdbde5a1209c2c43d9df0d160ae2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4109, "upload_time": "2019-08-14T21:40:23", "url": "https://files.pythonhosted.org/packages/8d/b9/af87f7f77b60d63a2b974393524e76b3c645dffa27b8d79503290872ff6a/gregorian-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "9fd3f9846a95b174f756159053bb4c10", "sha256": "1bb119e1100c671024179b64f19ae7dbb3a51501fbc2f14623f0053e943e2e04" }, "downloads": -1, "filename": "gregorian-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9fd3f9846a95b174f756159053bb4c10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5233, "upload_time": "2019-08-25T08:48:58", "url": "https://files.pythonhosted.org/packages/bc/2e/4ea88128641401764debf022affaf9844ab4dc78ec87e7e6f7d1b3352e60/gregorian-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9fd3f9846a95b174f756159053bb4c10", "sha256": "1bb119e1100c671024179b64f19ae7dbb3a51501fbc2f14623f0053e943e2e04" }, "downloads": -1, "filename": "gregorian-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9fd3f9846a95b174f756159053bb4c10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5233, "upload_time": "2019-08-25T08:48:58", "url": "https://files.pythonhosted.org/packages/bc/2e/4ea88128641401764debf022affaf9844ab4dc78ec87e7e6f7d1b3352e60/gregorian-0.0.2.tar.gz" } ] }