Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/c10udburst/wawbus
https://github.com/c10udburst/wawbus
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/c10udburst/wawbus
- Owner: C10udburst
- License: other
- Created: 2024-01-28T12:30:12.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-05-01T13:59:48.000Z (6 months ago)
- Last Synced: 2024-05-02T00:06:43.375Z (6 months ago)
- Language: Python
- Homepage: https://c10udburst.github.io/wawbus/
- Size: 1.71 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
=====
README
=====Wawbus is a Python library for analyzing bus data from Warsaw Public Transport
Jupyter notebooks with analysis
-------------------------------- `Part 1 `_ (opens Google Colab)
- `Part 2 `_ (opens Google Colab)Part 1 covers analyzing bus speed and part 2 covers analyzing bus delays.
.. warning::
When running notebooks via Google Colab, data collection is not possible.
This is because api.um.warszawa.pl blocks requests from data center IPs.Installation
------------- Download whl file from `releases `_
- Install it using pip:.. code-block:: bash
pip install wawbus-*-py3-none-any.whl
Usage in code
-------------.. code-block:: python
from wawbus import WawBus
wb = WawBus(apikey='your_api')
## OR
wb = WawBus(dataset='nameofdataset')wb.collect_positions(50)
wb.dataset # pandas DataFrame with bus positions
wb.calculate_speed() # retuns a new DataFrame with speed for each entry
Datasets are stored `here `_.
Usage in command line
---------------------.. code-block::
python3 -m wawbus --help
usage: python3 -m wawbus [-h] [--apikey APIKEY] [--type {positions,timetable}] [--count COUNT] [--retry RETRY] [--sleep SLEEP] [--workers WORKERS] [--output OUTPUT]
Collect bus positions from api.um.warszawa.ploptions:
-h, --help show this help message and exit
--apikey APIKEY api.um.warszawa.pl API key. If set to 'env', will use WAWBUS_APIKEY.environment variable
--type {positions,timetable,stops}
What to collect
--count COUNT number of collections
--retry RETRY number of retries
--sleep SLEEP sleep between collections
--workers WORKERS number of workers when collecting timetables
--output OUTPUT output file