A package for analysing public transport data
Project description
Python module for the analysis of public busses in Warsaw, Poland
A Python module that analyzes publicly available data on public busses in Warsaw, Poland. The data is available at the Warsaw Public Transport Authority. The project's goals are to: (1) visualize where the busses exceed the speed of 50 km/h, (2) analyze the punctuality of the busses as well as evaluate in which districts do the busses tends to be late, and (3) analyze whether there is a correlation between busses exceeding the speed of 50 km/h and them speeding in the vicinity of theaters.
Installation
Documentation
collect_all_data(api_key, data_set_size: int = 60, spacing: int = 60) -> None - Collects all the data from the API (ie. the bus schedules, bus routes, bus stops, the positions of theaters in Warsaw and the current positions of the busses) and saves it in appropriate directories.
collect_bus_routes(api_key: str) -> None - Collects the bus routes and saves them in the "bus_routes" directory.
collect_bus_schedules(apikey: str) -> None - Collects the bus schedules and saves them in the "bus_data/bus_lines" directory.
fetch_bus_stops(apikey: str) -> None - Fetches the bus stops and saves them in the "bus_data/bus_stops" directory.
fetch_current_positions(api_key: str, iterations: int, spacing: int = 10) -> None - Fetches the current positions of the busses and saves them in the "data_sets" directory.
fetch_theaters(api_key: str) -> None - Fetches the positions of theaters in Warsaw and saves them in the "theaters_data" directory.
analyze_all(data_set: int, streets: bool = False) -> None - analyzes all the data collected and saves the plots in the "plots" directory. The streets parameter is used to determine whether to analyze the data in the context of streets as well as districts (by default only districts are analyzed).
calculate_total_lateness(data_set: int) -> None - transforms the data into a format that allows for the calculation of the total delays of the busses in Warsaw.
filter_data_set(data_set: int, streets: bool = False, radius: int = 700) -> None - filters the data set into a more friendly format for the analysis. If the streets parameter is set to True, the data is filtered to include the streets at which the busses sent out data by sending a request to the GUGiK API. The radius parameter is used to determine the radius around the positions in which to look for streets.
plot_theaters_map(data_set: int) -> None - plots the positions of the theaters in Warsaw and the positions of the busses that exceed the speed of 50 km/h.
plot_street_percentage(data_set: int, number: int = 10) -> None - plots the percentage of infractions that happened on the top {number} streets in a bar chart.
plot_district_percentage(data_set: int) -> None - plots the percentage of infractions that happened in each district in a bar chart.
plot_percentage_per_district(data_set: int) -> None - plots the percentage of infractions that happened in each district as a part of the total number of infractions in a pie chart.
plot_number_of_infractions(data_set: int) -> None - plots the number of infractions that happened in each district.
draw_map(data_set: int) -> None - draws a map of Warsaw with the speeding busses and alongside the percentage of infractions in each district. Red lines represent the places where the busses were speeding.
plot_lateness(data_set: int) -> None - Plots the number of minutes late for all of Warsaw and all of Warsaw's districts.
Usage
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bus_project_NJ-0.0.1.tar.gz.
File metadata
- Download URL: bus_project_NJ-0.0.1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
639617cd2aad68ffa6ae5ee1247db3286764c922c5b41acb47a9c7693c4fcee6
|
|
| MD5 |
150df0d69ce374b793a4bd052eba1a06
|
|
| BLAKE2b-256 |
01792a81ec6902f0161bca82df01b92a28243ee71f498f99a3e1628d89c4bb42
|
File details
Details for the file bus_project_NJ-0.0.1-py3-none-any.whl.
File metadata
- Download URL: bus_project_NJ-0.0.1-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdc55b1e76a43a53a42591b8f1eea2a60db7bac203ac8ab39b0f7cec0c43ba2c
|
|
| MD5 |
9fd9f1d9abd4b635d50e39981e1aaae3
|
|
| BLAKE2b-256 |
5507b7abf75b721ef87a148c0114c07946483e47678a606e720dcf3663788fde
|