Skip to main content

pywarsaw

actionsDocumentation StatusProject Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.Downloads

An unofficial asynchronous API wrapper for Warsaw Open Data.

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:

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:

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:

await client.cache_disable()

Every object from the obtained list an be converted to the simpler structures:

# 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 ✔️

Public transport

  • ZTM timetables:
    • stops ✔️
    • lines ✔️
    • timetables ✔️
  • transport (vector maps):
    • cycle stations ✔️
    • cycle tracks ✔️
    • parking lots ✔️
    • subway entrances ✔️
  • stops information:
    • coordinates ✔️
    • current day coordinates ✔️

Education

  • computers and internet access:
    • internet access ✔️
    • computers purpose ✔️
  • statics about schools ❌
  • education - rooms ❌
  • schools ❌

Ecology

  • shrubs:
    • shrubs ✔️
    • groups of shrubs ✔️
  • forests:
    • forests ✔️
  • trees:
    • groups of trees ✔️
    • trees ✔️
  • munincipal waste:
    • waste segregation ✔️
  • air quality:
    • air quality ✔️

Online data

  • trams and buses:
    • trams and buses ✔️
  • queuing systems ❌
  • road works:
    • companies ✔️
    • categories ✔️
    • districts ✔️
    • investments ✔️
    • investments details ❌

Spatial data

  • ATMs ❌
  • names of urban objects ❌
  • health ❌
  • bikes ❌
  • sport ❌
  • accommodation ❌

Safety

  • defibrillators:
    • defibrillators ✔️
  • safety (vector maps) ❌

Official data

  • administration (vector maps) ❌
  • 19115 ❌
  • sport ❌
  • events ❌

Terms of data usage

Translated from here.

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

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:

Metadata

Release files for pywarsaw 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywarsaw 0.1.1
File Size Uploaded
pywarsaw-0.1.1.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pywarsaw 0.1.1
File Interpreter ABI Platform
pywarsaw-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / pywarsaw-0.1.1.tar.gz

Download URL pywarsaw-0.1.1.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
33cfca71a4c31634f4d841be50d09dfcf8476331559f7da33805788e803e0660
BLAKE2b-256 checksum
How to use checksums
f3c60ec6c6d0a52300f038ab91919464b6b07eda74fd5b1756f40c67573d181d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.9 Linux/6.1.10-arch1-1

Release files / pywarsaw-0.1.1-py3-none-any.whl

Download URL pywarsaw-0.1.1-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3f10ac90049b2a470ff4ecc9f872a916badf7ee4c2e5d5d6723a9b4ff988a50
BLAKE2b-256 checksum
How to use checksums
0c059ecc8002472c1c11486662621adfabafb1269d2b44f95c9b7c4f064006a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.9 Linux/6.1.10-arch1-1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page