This Python package provides a convenient wrapper to interact with the OASA S.A. (Athens Public Transport) API, allowing users to retrieve various information related to the public transport network in Athens, Greece.
Project description
OASA API Wrapper
This Python package provides a convenient wrapper for interacting with the OASA S.A. (Athens Public Transport) API, allowing users to retrieve various information related to the public transport network in Athens, Greece.
The OASA S.A. API provides access to information such bus lines, schedules, routes, stops, arrivals, and bus locations. The information obtained through this package corresponds to the data available on the OASA S.A. website, providing users with a programmatic way to access the same data.
Installation
You can install the package via pip:
pip install oasa-api
Usage
To use the package, simply import the OASAApi class from the oasa_api module and create an instance of it. Then, you can call various methods to retrieve information from the OASA API.
Here's an example of how to retrieve information about lines with master line info:
from oasa_api import OASAApi
# Create an instance of OASAApi
oasa_api = OASAApi()
# Retrieve information about lines with master line info
lines_with_master_line_info = oasa_api.get_lines_with_master_line_info()
print(lines_with_master_line_info)
For more detailed usage examples, please refer to the demo notebook.
Available Methods
get_master_lines()get_master_line_name(ml_code: int)get_lines_with_master_line_info()get_lines_and_routes_for_master_line_and_line_code(ml_code: int, line_code: int)get_lines()get_line_name(line_code: int)get_schedule_days_master_line(line_code: int)get_daily_schedule(line_code: int)get_sched_lines(ml_code: int, sdc_code: int, line_code: int)get_routes(line_code: int)get_routes_for_line(line_code: int)get_route_name(route_code: int)get_routes_details_and_stops(route_code: int)get_route_details(route_code: int)get_stops(route_code: int)get_routes_for_stops(stop_code: int)get_stop_name_and_xy(stop_code: int)get_closest_stops(lng: float, lat: float)get_stop_arrivals(stop_code: int)get_bus_location(route_code: int)
For detailed information about each method, refer to the documentation in the source code.
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
Acknowledgements
Special thanks to Pretzel for writing a helpful tutorial on creating Python SDK libraries for REST APIs, and to ChatGPT for assisting with the documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 oasa_api-0.1.1.tar.gz.
File metadata
- Download URL: oasa_api-0.1.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79d8bf9cf21563cc7fee15847edaac6aed58a02708e07d4e746a3465c4f1d20b
|
|
| MD5 |
d26e0be8e22f182a48b8778c2d0ba5f5
|
|
| BLAKE2b-256 |
6c42661302544fea4310d59b29f7dd947677a4cc61f3fdc4db88f65afa55b0e0
|
File details
Details for the file oasa_api-0.1.1-py3-none-any.whl.
File metadata
- Download URL: oasa_api-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3771faebb70e6a872678a6a4e4df31b14710018e019a52df3c6449dd4bfbdea
|
|
| MD5 |
0ce330c0c4f71707221912e6319d8d23
|
|
| BLAKE2b-256 |
1eecaa8ce9e54601887798099fdb489242a2cde516c28c7960f18e2d58be322c
|