A package for the University of Warsaw Python Course
Project description
🚌 BusProjectUW_KO - my Python project for UW Python class
Project about buses in Warsaw.
🥅 Project Goals
This project aims to achieve the following goals:
- Show routes of buses in Warsaw that exceed the speed of 50 km/h.
- Evaluate the delays of buses according to their schedule.
By accomplishing these goals, the project aims to provide valuable insights into the efficiency and performance of the bus system in Warsaw.
All results are district-focused.
🍱 Sample code
Collect ALL data and analyse
Note: It will take up to 6h, however must be run at least once to collect necessary bus data.
from BusProjectUW_KO import collect_all
from BusProjectUW_KO import analyse_all
import os
api_key = "your_api_key" # API key for UM API
path = os.getcwd()
dataSet = collect_all(path, api_key)
analyse_all(path, dataSet)
Collect only bus positions
Note: It will take ~ 10 * dataSize seconds.
from BusProjectUW_KO import collect_current_positions
from BusProjectUW_KO import analyse_all
import os
api_key = "your_api_key" # API key for UM API
path = os.getcwd()
dataSize = 100
dataSet = collect_current_positions(path, api_key, dataSize)
analyse_all(path, dataSet)
Only plot data -> must be collected and analysed before
Note: It will be fast 😎
from BusProjectUW_KO import plot_data_set_schedule
from BusProjectUW_KO import plot_data_set_speed
import os
dataSet = 1 # MUST HAVE ALREADY BEEN CREATED AND ANALYSED
path = os.getcwd()
plot_data_set_schedule(path, dataSet)
plot_data_set_speed(path, dataSet)
📖 Documentation
💰 collect data
-
collect_all(path: str, api_key: str, dataSize: int = 100 -> intcollects all data mentioned below -> all needed data for the project and returns the new dataSet id -
collect_busStops(path: str, api_key : str) -> Nonegets bus stop positions -
collect_dictionary(path: str, api_key: str) -> None:gets a dictionary with definitions from the api -
collect_public_transport_routes(path: str, api_key: str) -> None:gets public transport routes - information about busstops for each line -
collect_schedule(path: str, api_key: str) -> None:gets a full schedule for all lines and all brigades. This function takes AGES, so make sure to make yourself a cup of tea. Slow but O(1) 😎 -
collect_current_positions(path: str, api_key: str, dataSize: int = 100) -> int:creates a new dataSet by collecting data. Will take at least (dataSize * 10 seconds)
🤔 analyse data
(it also plots -> saves to file)
-
analyse_all(path: str, dataSet: int = 1) -> None:Analyses the data, saves segments and points that are in Warsaw. Analyses buses in terms of both excesive speed and possible delay -
analyse_speed(path: str, dataSet: int = 1) -> None:Analyses the data, saves segments and points that are in Warsaw. Analyses buses ONLY in terms of excesive speed. Kinda slow. -
analyse_schedule(path: str, dataSet: int = 1) -> NoneAnalyses the data, saves segments and points that are in Warsaw. Analyses buses ONLY in temrs of possible delays. Even slower.
🗺️ 📊 plot data
-
plot_data_set_schedule(path: str, dataSet: int = 1, show: bool = False) -> None:assumes that the dataSet has already been analysed and only prepares a plot regarding schedule.showset toTruewill show the plot. -
plot_data_set_speed(path: str, dataSet: int = 1, show: bool = False) -> None:assumes that the dataSet has already been analysed and only prepares a plot regarding excessive speed.showset toTruewill show the plot.
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 BusProjectUW_KO-0.0.2.tar.gz.
File metadata
- Download URL: BusProjectUW_KO-0.0.2.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1c245db0732765834d5d4429bc60d61ee4efab71e40845cdba683e621073267
|
|
| MD5 |
2b54370b8ec63b2537e4b3639fefbf34
|
|
| BLAKE2b-256 |
ce57afa2036594982b0f1e5d6acb9ca2aa4fd5fa58af660d4f200ccf5dfd26ea
|
File details
Details for the file BusProjectUW_KO-0.0.2-py3-none-any.whl.
File metadata
- Download URL: BusProjectUW_KO-0.0.2-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52be5403e258612b562c2f48bb5c0ee8a6b9f3d6d1eff0038e554496caa94077
|
|
| MD5 |
4b288a9ae83239fb92e81a315bdcccaa
|
|
| BLAKE2b-256 |
82534c51ccfdf66457a244df3a650083fd7e4841fb83a960c716b707cb984f0c
|