Skip to main content

Warsaw data python api

Project description

Pythonic way to use Warsaw data API

This package allow to fetch data from API provided by "UM Warszawa" - https://api.um.warszawa.pl/

Current features

  • Fetch ZTM buses and trams real-time location
  • Fetch Schedule for bus stop for certain bus line

Getting Started

Installation

pip install warsaw-data-api

Using ZTM module

Get buses/trams locations:

We can fetch all location data for buses:

import warsaw_data_api

ztm = warsaw_data_api.ztm(apikey='your_api_key')
buses = ztm.get_buses_location()

for bus in buses:
    print(bus)

We can do the same for trams, as a parameter we can set number of tram line

import warsaw_data_api

ztm = warsaw_data_api.ztm(apikey='your_api_key')
trams = ztm.get_trams_location(line=17)

for tram in trams:
    print(tram)

Get buses schedule:

We can fetch schedule by using bus stop id:

import warsaw_data_api

ztm = warsaw_data_api.ztm(apikey='your_api_key')
schedule = ztm.get_bus_stop_schedule_by_id(7009, "01", "182")
print(schedule)

or we can fetch it by using bus stop name:

import warsaw_data_api

ztm = warsaw_data_api.ztm(apikey='your_api_key')
schedule = ztm.get_bus_stop_schedule_by_name("Marszałkowska", "01", "182")
print(schedule)

Passing API Key

We can pass API Key in two different ways:

  1. Pass API Key to factory function (ztm() in this case) as a parameter ztm = warsaw_data_api.ztm(apikey='your_api_key')
  2. Create environment variable called WARSAW_DATA_API_KEY

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

warsaw_data_api-0.3.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

warsaw_data_api-0.3.4-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file warsaw_data_api-0.3.4.tar.gz.

File metadata

  • Download URL: warsaw_data_api-0.3.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.30.0 requests-toolbelt/1.0.0 urllib3/2.0.2 tqdm/4.65.0 importlib-metadata/6.6.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.11

File hashes

Hashes for warsaw_data_api-0.3.4.tar.gz
Algorithm Hash digest
SHA256 36ca19e7a1c61d845bb84cd9b2922401fc31dbdd0fdc8144be4d75186414db81
MD5 d600583e30236009761a64b370233906
BLAKE2b-256 bb17d239a2ca3750beaecc7a4a310511675dba613119403c0bb3da76b200b140

See more details on using hashes here.

File details

Details for the file warsaw_data_api-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: warsaw_data_api-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.30.0 requests-toolbelt/1.0.0 urllib3/2.0.2 tqdm/4.65.0 importlib-metadata/6.6.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.11

File hashes

Hashes for warsaw_data_api-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9efbc03acda95a74fd818743cc6d1ebe70176fd997dad984a201ab7844ad53fb
MD5 06eb5274726e7f86a6a47d06da4d2d03
BLAKE2b-256 34ab2d7d97baed9f207cad7ed1b8970be1ec3873f2a5686d52a09d4bdff4bd64

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page