{ "info": { "author": "Dennis Muth", "author_email": "den.muth@googlemail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development" ], "description": "# ferien-api\n\n[![PyPI version](https://badge.fury.io/py/ferien-api.svg)](https://badge.fury.io/py/ferien-api)\n[![Build Status](https://travis-ci.org/HazardDede/ferien-api.svg?branch=master)](https://travis-ci.org/HazardDede/ferien-api)\n[![Coverage Status](https://coveralls.io/repos/github/HazardDede/ferien-api/badge.svg?branch=master)](https://coveralls.io/github/HazardDede/ferien-api?branch=master)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n> Python client library for ferien-api.de\n\n## Installation\n\n`ferien-api` needs python 3.5+ to function properly\n\n```\npip install ferien-api\n```\n\n## Usage\n\nYou could use the synchronous implementation which will block until a response arrives from the api\nor you could use the async implementation which will be non-blocking your other async stuff.\n\n**Synchronous**:\n\n```python\nimport ferien\n\n\ndef main():\n # Get all vacations for all time and states\n print(\"All vacations:\", ferien.all_vacations())\n\n # Get all vacations for a specific state (in this case Hamburg - HH) ...\n print(\"All vacations for HH:\", ferien.state_vacations('HH'))\n\n # ... and optionally for a specific year\n print(\"All vacations for HH in 2019:\", ferien.state_vacations('HH', 2019))\n\n # Fetch all valid states\n print(\"Valid state codes:\", ferien.state_codes())\n\n # Get current vacation (None if there is no vacation)\n print(\"Current vacation in HH:\", ferien.current_vacation('HH'))\n\n # Get next vacation (None if there is no next vacation)\n print(\"Next vacation in HH:\", ferien.next_vacation('HH'))\n\n\nif __name__ == '__main__':\n main()\n\n```\n\n**Asynchronous**:\n\n```python\nimport asyncio\n\nimport ferien\n\n\nasync def main():\n # Get all vacations for all time and states\n print(\"All vacations:\", await ferien.all_vacations_async())\n\n # Get all vacations for a specific state (in this case Hamburg - HH) ...\n print(\"All vacations for HH:\", await ferien.state_vacations_async('HH'))\n\n # ... and optionally for a specific year\n print(\"All vacations for HH in 2019:\", await ferien.state_vacations_async('HH', 2019))\n\n # Fetch all valid states. This one is _NOT_ async\n print(\"Valid state codes:\", ferien.state_codes())\n\n # Get current vacation (None if there is no vacation)\n print(\"Current vacation in HH:\", ferien.current_vacation(vacs=await ferien.state_vacations_async('HH')))\n\n # Get next vacation (None if there is no next vacation)\n print(\"Next vacation in HH:\", ferien.next_vacation(vacs=await ferien.state_vacations_async('HH')))\n\n\nif __name__ == '__main__':\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main())\n\n```\n\nBoth implementations of `all_vacations` and `state_vacations` will return a list of `Vacation` data objects.\nSee below for the definition of a `Vacation` object.\n\n```python\nVacation(\n start=datetime.datetime(2020, 12, 21, 0, 0),\n end=datetime.datetime(2021, 1, 5, 0, 0),\n year=2020,\n state_code='HH',\n name='weihnachtsferien',\n slug='weihnachtsferien-2020-HH'\n)\n```\n\n*Please note*: All datetime objects are in the `Europe/Berlin (CET/CEST)` timezone\n\nUsing the async version it is easy to make multiple requests in \"parallel\" (not true... you know that when you are\nan asyncio enthusiast) and save a lot of time:\n\n```python\nimport asyncio\n\nimport ferien\n\n\nasync def print_wrapper(state_code):\n print(\"Fetching {}\".format(state_code))\n res = await ferien.state_vacations_async(state_code, 2019)\n print(\"Fetched {}\".format(state_code))\n return res\n\n\nif __name__ == '__main__':\n loop = asyncio.get_event_loop()\n coros = [\n print_wrapper('HH'),\n print_wrapper('SH'),\n print_wrapper('BE'),\n print_wrapper('BB')\n ]\n loop.run_until_complete(asyncio.gather(*coros))\n\n```\n\n## Changelog\n\n**0.3.4**\n* Fixes incorrect localization to Europe/Berlin for dates\n\n**0.3.3**\n* Changes all timestamps from naive to 'Europe/Berlin'\n\n**0.3.2**\n* Adds type hints to codebase\n* Adds mypy as a linter\n\n**0.3.1**\n* Adds pylint as a linter and make him happy!\n\n**0.3.0**\n* Adds `current_vacation` and `next_vacation` implementations\n\n**0.2.0**\n* Adds an async implementation of `all_vacations` and `state_vacations`\n\n**0.1.0**\n* Initial version", "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/HazardDede/ferien-api", "keywords": "ferien api client", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ferien-api", "package_url": "https://pypi.org/project/ferien-api/", "platform": "", "project_url": "https://pypi.org/project/ferien-api/", "project_urls": { "Documentation": "https://github.com/HazardDede/ferien-api/blob/master/README.mdpp", "Homepage": "https://github.com/HazardDede/ferien-api", "Source": "https://github.com/HazardDede/ferien-api/", "Tracker": "https://github.com/HazardDede/ferien-api/issues" }, "release_url": "https://pypi.org/project/ferien-api/0.3.4/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Python client library for ferien-api.de", "version": "0.3.4" }, "last_serial": 5374310, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "caee8214de2687a0566c71e6f97f6def", "sha256": "f06759c9b23e963eceec36ffe4122fc0b268917ebcd42072eb61f2d35e4a4849" }, "downloads": -1, "filename": "ferien-api-0.1.0.tar.gz", "has_sig": false, "md5_digest": "caee8214de2687a0566c71e6f97f6def", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3470, "upload_time": "2019-02-22T11:56:47", "url": "https://files.pythonhosted.org/packages/54/2a/5b418cc03f95a3cef343cee7dbe7151b3bc99616856f76330e27867d3180/ferien-api-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1ce0ed5f84e1f0617c00d22a057cfd47", "sha256": "01b938a738f5f5cc1661480ccab15672b72417a17895754b5a9a617b4789237f" }, "downloads": -1, "filename": "ferien-api-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1ce0ed5f84e1f0617c00d22a057cfd47", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4574, "upload_time": "2019-02-22T19:49:53", "url": "https://files.pythonhosted.org/packages/fc/c8/38e2350d27c866e1dec12f050241a02dc416175123b9c1e59c6e009e8042/ferien-api-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "16a0014058f26c2841b7000d0ac4e9cd", "sha256": "b67be3559c03e8340062b1260fa8ecbc79af325f717fa44ed2a19dc3cf7c1451" }, "downloads": -1, "filename": "ferien-api-0.3.0.tar.gz", "has_sig": false, "md5_digest": "16a0014058f26c2841b7000d0ac4e9cd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 5244, "upload_time": "2019-02-27T19:12:53", "url": "https://files.pythonhosted.org/packages/b0/f8/98e0f24b4af2bd2b3a886e3c58597b0f957f20087e282c04991db544df1f/ferien-api-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "501c037f9e6626efe20f78340d17073b", "sha256": "3deb212d95414350308de06ddb5f3483ad1e8aa2b8c0a52f990e7f901d56bc3b" }, "downloads": -1, "filename": "ferien-api-0.3.1.tar.gz", "has_sig": false, "md5_digest": "501c037f9e6626efe20f78340d17073b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 5549, "upload_time": "2019-03-20T19:06:55", "url": "https://files.pythonhosted.org/packages/a7/85/7daa64f4f0a25c40d2c464247530f18ff9904c9ce914322c4716965cd229/ferien-api-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "6635ce70fe0a2468954a061e4eb971ae", "sha256": "876fd5ee0b2d77bd5b8bfafa1df470db03ca8d952297b2a48abeee6e99eb6283" }, "downloads": -1, "filename": "ferien-api-0.3.2.tar.gz", "has_sig": false, "md5_digest": "6635ce70fe0a2468954a061e4eb971ae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 5989, "upload_time": "2019-04-28T10:39:51", "url": "https://files.pythonhosted.org/packages/98/63/0cc3583630f5e74c7df329ab6c8f59fbb9aa656c718e94392fa0d660d78d/ferien-api-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "f5362ddcb2689c962e1484f32b72113f", "sha256": "ba6d1bf8e8604d175db82b8307df269d7acd31eb4e220fe276e295aa010bc5ad" }, "downloads": -1, "filename": "ferien-api-0.3.3.tar.gz", "has_sig": false, "md5_digest": "f5362ddcb2689c962e1484f32b72113f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6350, "upload_time": "2019-06-02T10:49:19", "url": "https://files.pythonhosted.org/packages/b6/1d/636fd463565fef662871696a2f881cf9cf3fc76eb16e1135c898fe7ac00a/ferien-api-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "d261b917ce75fdd8f17887771d687852", "sha256": "3c98f1eea59d084594ed2dc9441622a5331430b2b939c564aec1bada6688bfc3" }, "downloads": -1, "filename": "ferien-api-0.3.4.tar.gz", "has_sig": false, "md5_digest": "d261b917ce75fdd8f17887771d687852", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6406, "upload_time": "2019-06-08T04:08:30", "url": "https://files.pythonhosted.org/packages/44/53/08030d74bf248eeffd6746d8ef69d9ad0a5fea7321371bb5baeb366d822a/ferien-api-0.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d261b917ce75fdd8f17887771d687852", "sha256": "3c98f1eea59d084594ed2dc9441622a5331430b2b939c564aec1bada6688bfc3" }, "downloads": -1, "filename": "ferien-api-0.3.4.tar.gz", "has_sig": false, "md5_digest": "d261b917ce75fdd8f17887771d687852", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6406, "upload_time": "2019-06-08T04:08:30", "url": "https://files.pythonhosted.org/packages/44/53/08030d74bf248eeffd6746d8ef69d9ad0a5fea7321371bb5baeb366d822a/ferien-api-0.3.4.tar.gz" } ] }