pywarsaw


Namepywarsaw JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/BrozenSenpai/pywarsaw
SummaryAn unofficial asynchronous API wrapper for Warsaw Open Data - https://api.um.warszawa.pl/
upload_time2023-02-09 22:13:51
maintainer
docs_urlNone
authorbrozen
requires_python>=3.9,<4.0
licenseMIT
keywords warsaw
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pywarsaw
![actions](https://github.com/BrozenSenpai/pywarsaw/actions/workflows/python-package.yml/badge.svg)[![Documentation Status](https://readthedocs.org/projects/pywarsaw/badge/?version=latest)](https://pywarsaw.readthedocs.io/en/latest/?badge=latest)[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)[![Downloads](https://static.pepy.tech/badge/pywarsaw)](https://pepy.tech/project/pywarsaw)

An unofficial asynchronous API wrapper for [Warsaw Open Data](https://api.um.warszawa.pl/).

Created mainly for learning purposes.

Package is still in progress, check the work status in the *currently covered* section.

## Features
- **Asynchronous**: designed to work with asyncio
- **Extensive**: cover as many endpoints as possible
- **Approachable**: all polish fields translated to english
- **Responsible**: minimize the load on the API server
    - implemented caching
- **Simple**: easy to use and customize:
    - object-oriented design
    - use of data transfer objects
    - type hinting
    - convert adequate fields from strings to the more suitable types
- **Lightweight**: minimal usage of the third-party packages

## Installation
```
pip install pywarsaw
```

## Getting started
The package goal is to be straightforward to use. For example, you can obtain a list of objects with information about current air quality in Warsaw, with caching enabled like this:
```python
import asyncio
import pywarsaw

async def main():
    client = pywarsaw.Mermaid(api_key="YOUR_API_KEY")
    await client.cache_enable()

    result = await client.get_air_quality()
    
    await client.close()

asyncio.run(main())
```
Or with the context manager:
```python
async with pywarsaw.Mermaid(api_key="YOUR_API_KEY") as client:
    await client.cache_enable()
    
    result = await client.get_air_quality()
```
Caching can be disabled with:
```python
await client.cache_disable()
```
Every object from the obtained list an be converted to the simpler structures:
```python
# convert object to the dictionary
result_dict = result[0].to_dict()

# convert object to the tuple
result_tuple = result[0].to_tuple()

# convert object to the flat dict - useful for creating Pandas dataframes
result_flat = result[0].to_flat_dict()

# convert object to the json string
result_json = result[0].to_json()
```

## Currently covered
Warsaw Open Data has a lot of different endpoints and data categories to cover.

The current status of work is:

**Culture**
* culture (vector maps):
    * theathers :heavy_check_mark:

**Public transport**
* ZTM timetables:
    * stops :heavy_check_mark:
    * lines :heavy_check_mark:
    * timetables :heavy_check_mark:
* transport (vector maps):
    * cycle stations :heavy_check_mark:
    * cycle tracks :heavy_check_mark:
    * parking lots :heavy_check_mark:
    * subway entrances :heavy_check_mark:
* stops information:
    * coordinates :heavy_check_mark:
    * current day coordinates :heavy_check_mark:

**Education**
* computers and internet access:
    * internet access :heavy_check_mark:
    * computers purpose :heavy_check_mark:
* statics about schools :x:
* education - rooms :x:
* schools :x:

**Ecology**
* shrubs:
    * shrubs :heavy_check_mark:
    * groups of shrubs :heavy_check_mark:
* forests:
    * forests :heavy_check_mark:
* trees:
    * groups of trees :heavy_check_mark:
    * trees :heavy_check_mark:
* munincipal waste:
    * waste segregation :heavy_check_mark:
* air quality:
    * air quality :heavy_check_mark:

**Online data**
* trams and buses:
    * trams and buses :heavy_check_mark:
* queuing systems :x:
* road works:
    * companies :heavy_check_mark:
    * categories :heavy_check_mark:
    * districts :heavy_check_mark:
    * investments :heavy_check_mark:
    * investments details :x:

**Spatial data**
* ATMs :x:
* names of urban objects :x:
* health :x:
* bikes :x:
* sport :x:
* accommodation :x:

**Safety**
* defibrillators:
    * defibrillators :heavy_check_mark:
* safety (vector maps) :x:

**Official data**
* administration (vector maps) :x:
* 19115 :x:
* sport :x:
* events :x:

## Terms of data usage
Translated from [here](https://api.um.warszawa.pl/#).

Public data available on the service are official materials and as such are not protected by copyright law. You may use this data freely but must comply with the conditions for reusing public information outlined in the law on the reuse of public sector information of 25th February 2016.

When using public information made available on the Open Data After Warsaw service, you must:
* Include information about the source of the data, including the name: Capital City of Warsaw, and the URL of the Open Data After Warsaw service: http://api.um.warszawa.pl (if possible)
* Provide the date of creation and acquisition of public information

Reusing public sector information available on the service is done at your own risk. The Capital City of Warsaw assumes no responsibility for any damage resulting from your or other users' reuse of this information. Some of the information processed by third parties that you may reuse may be outdated or contain errors, and the Capital City of Warsaw reserves the right to this possibility.

## Documentation
The documentation is hosted on [ReadTheDocs.io](https://pywarsaw.readthedocs.io/en/latest/)

## Help, questions, and contributing
All contributors are very welcome. If you have any questions or a bug to report feel free to open an issue.

## External packages
Pywarsaw depends on these third-party packages:


* [attrs](https://www.attrs.org/en/stable/)
* [aiohttp](https://docs.aiohttp.org/en/stable/)
* [aiohttp-client-cache](https://pypi.org/project/aiohttp-client-cache/)
* [aiosqlite](https://github.com/omnilib/aiosqlite)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/BrozenSenpai/pywarsaw",
    "name": "pywarsaw",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "Warsaw",
    "author": "brozen",
    "author_email": "szymon.mazurkievicz@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f3/c6/0ec6c6d0a52300f038ab91919464b6b07eda74fd5b1756f40c67573d181d/pywarsaw-0.1.1.tar.gz",
    "platform": null,
    "description": "# pywarsaw\n![actions](https://github.com/BrozenSenpai/pywarsaw/actions/workflows/python-package.yml/badge.svg)[![Documentation Status](https://readthedocs.org/projects/pywarsaw/badge/?version=latest)](https://pywarsaw.readthedocs.io/en/latest/?badge=latest)[![Project Status: WIP \u2013 Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)[![Downloads](https://static.pepy.tech/badge/pywarsaw)](https://pepy.tech/project/pywarsaw)\n\nAn unofficial asynchronous API wrapper for [Warsaw Open Data](https://api.um.warszawa.pl/).\n\nCreated mainly for learning purposes.\n\nPackage is still in progress, check the work status in the *currently covered* section.\n\n## Features\n- **Asynchronous**: designed to work with asyncio\n- **Extensive**: cover as many endpoints as possible\n- **Approachable**: all polish fields translated to english\n- **Responsible**: minimize the load on the API server\n    - implemented caching\n- **Simple**: easy to use and customize:\n    - object-oriented design\n    - use of data transfer objects\n    - type hinting\n    - convert adequate fields from strings to the more suitable types\n- **Lightweight**: minimal usage of the third-party packages\n\n## Installation\n```\npip install pywarsaw\n```\n\n## Getting started\nThe package goal is to be straightforward to use. For example, you can obtain a list of objects with information about current air quality in Warsaw, with caching enabled like this:\n```python\nimport asyncio\nimport pywarsaw\n\nasync def main():\n    client = pywarsaw.Mermaid(api_key=\"YOUR_API_KEY\")\n    await client.cache_enable()\n\n    result = await client.get_air_quality()\n    \n    await client.close()\n\nasyncio.run(main())\n```\nOr with the context manager:\n```python\nasync with pywarsaw.Mermaid(api_key=\"YOUR_API_KEY\") as client:\n    await client.cache_enable()\n    \n    result = await client.get_air_quality()\n```\nCaching can be disabled with:\n```python\nawait client.cache_disable()\n```\nEvery object from the obtained list an be converted to the simpler structures:\n```python\n# convert object to the dictionary\nresult_dict = result[0].to_dict()\n\n# convert object to the tuple\nresult_tuple = result[0].to_tuple()\n\n# convert object to the flat dict - useful for creating Pandas dataframes\nresult_flat = result[0].to_flat_dict()\n\n# convert object to the json string\nresult_json = result[0].to_json()\n```\n\n## Currently covered\nWarsaw Open Data has a lot of different endpoints and data categories to cover.\n\nThe current status of work is:\n\n**Culture**\n* culture (vector maps):\n    * theathers :heavy_check_mark:\n\n**Public transport**\n* ZTM timetables:\n    * stops :heavy_check_mark:\n    * lines :heavy_check_mark:\n    * timetables :heavy_check_mark:\n* transport (vector maps):\n    * cycle stations :heavy_check_mark:\n    * cycle tracks :heavy_check_mark:\n    * parking lots :heavy_check_mark:\n    * subway entrances :heavy_check_mark:\n* stops information:\n    * coordinates :heavy_check_mark:\n    * current day coordinates :heavy_check_mark:\n\n**Education**\n* computers and internet access:\n    * internet access :heavy_check_mark:\n    * computers purpose :heavy_check_mark:\n* statics about schools :x:\n* education - rooms :x:\n* schools :x:\n\n**Ecology**\n* shrubs:\n    * shrubs :heavy_check_mark:\n    * groups of shrubs :heavy_check_mark:\n* forests:\n    * forests :heavy_check_mark:\n* trees:\n    * groups of trees :heavy_check_mark:\n    * trees :heavy_check_mark:\n* munincipal waste:\n    * waste segregation :heavy_check_mark:\n* air quality:\n    * air quality :heavy_check_mark:\n\n**Online data**\n* trams and buses:\n    * trams and buses :heavy_check_mark:\n* queuing systems :x:\n* road works:\n    * companies :heavy_check_mark:\n    * categories :heavy_check_mark:\n    * districts :heavy_check_mark:\n    * investments :heavy_check_mark:\n    * investments details :x:\n\n**Spatial data**\n* ATMs :x:\n* names of urban objects :x:\n* health :x:\n* bikes :x:\n* sport :x:\n* accommodation :x:\n\n**Safety**\n* defibrillators:\n    * defibrillators :heavy_check_mark:\n* safety (vector maps) :x:\n\n**Official data**\n* administration (vector maps) :x:\n* 19115 :x:\n* sport :x:\n* events :x:\n\n## Terms of data usage\nTranslated from [here](https://api.um.warszawa.pl/#).\n\nPublic data available on the service are official materials and as such are not protected by copyright law. You may use this data freely but must comply with the conditions for reusing public information outlined in the law on the reuse of public sector information of 25th February 2016.\n\nWhen using public information made available on the Open Data After Warsaw service, you must:\n* Include information about the source of the data, including the name: Capital City of Warsaw, and the URL of the Open Data After Warsaw service: http://api.um.warszawa.pl (if possible)\n* Provide the date of creation and acquisition of public information\n\nReusing public sector information available on the service is done at your own risk. The Capital City of Warsaw assumes no responsibility for any damage resulting from your or other users' reuse of this information. Some of the information processed by third parties that you may reuse may be outdated or contain errors, and the Capital City of Warsaw reserves the right to this possibility.\n\n## Documentation\nThe documentation is hosted on [ReadTheDocs.io](https://pywarsaw.readthedocs.io/en/latest/)\n\n## Help, questions, and contributing\nAll contributors are very welcome. If you have any questions or a bug to report feel free to open an issue.\n\n## External packages\nPywarsaw depends on these third-party packages:\n\n\n* [attrs](https://www.attrs.org/en/stable/)\n* [aiohttp](https://docs.aiohttp.org/en/stable/)\n* [aiohttp-client-cache](https://pypi.org/project/aiohttp-client-cache/)\n* [aiosqlite](https://github.com/omnilib/aiosqlite)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An unofficial asynchronous API wrapper for Warsaw Open Data - https://api.um.warszawa.pl/",
    "version": "0.1.1",
    "split_keywords": [
        "warsaw"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c059ecc8002472c1c11486662621adfabafb1269d2b44f95c9b7c4f064006a6",
                "md5": "a11b802c7028c78aff55db5d6a078a92",
                "sha256": "e3f10ac90049b2a470ff4ecc9f872a916badf7ee4c2e5d5d6723a9b4ff988a50"
            },
            "downloads": -1,
            "filename": "pywarsaw-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a11b802c7028c78aff55db5d6a078a92",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 18996,
            "upload_time": "2023-02-09T22:13:49",
            "upload_time_iso_8601": "2023-02-09T22:13:49.523668Z",
            "url": "https://files.pythonhosted.org/packages/0c/05/9ecc8002472c1c11486662621adfabafb1269d2b44f95c9b7c4f064006a6/pywarsaw-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f3c60ec6c6d0a52300f038ab91919464b6b07eda74fd5b1756f40c67573d181d",
                "md5": "3f41f307d99c3e623480171cec116244",
                "sha256": "33cfca71a4c31634f4d841be50d09dfcf8476331559f7da33805788e803e0660"
            },
            "downloads": -1,
            "filename": "pywarsaw-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3f41f307d99c3e623480171cec116244",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 20507,
            "upload_time": "2023-02-09T22:13:51",
            "upload_time_iso_8601": "2023-02-09T22:13:51.449172Z",
            "url": "https://files.pythonhosted.org/packages/f3/c6/0ec6c6d0a52300f038ab91919464b6b07eda74fd5b1756f40c67573d181d/pywarsaw-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-09 22:13:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "BrozenSenpai",
    "github_project": "pywarsaw",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pywarsaw"
}
        
Elapsed time: 0.03981s