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:
- Pass API Key to factory function (
ztm()
in this case) as a parameterztm = warsaw_data_api.ztm(apikey='your_api_key')
- Create environment variable called
WARSAW_DATA_API_KEY
Project details
Release history Release notifications | RSS feed
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.5.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file warsaw_data_api-0.3.5.tar.gz
.
File metadata
- Download URL: warsaw_data_api-0.3.5.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1bdaad9b33a2350f315cace3e9f42afcd058f71dd1df29ff6b17794537d368f |
|
MD5 | f331bfc6b0e63a628af3940cbd279c39 |
|
BLAKE2b-256 | 56ad608896002b71e150ec2fca7ce0283aeb101703408c4ccefa1e7ce05d077a |
File details
Details for the file warsaw_data_api-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: warsaw_data_api-0.3.5-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c16a2a8ea91285f986de4c3cbbead633438fc9826023c692625c54c75bcc942e |
|
MD5 | b6bb94c491de00bcfa5f48052e94d2ea |
|
BLAKE2b-256 | 2a2fcca58805649cc4e7460d6da46dd454b62fb3a41582ed171fc109ca4ec9bf |