Get RATP data from RATP API.
Project description
RatpAPI Python Wrapper
Overview
RatpAPI is a Python wrapper for interacting with the RATP (Régie Autonome des Transports Parisiens) API. This library provides easy access to real-time traffic information, line-specific traffic details, and affluence data for journeys on the RATP network in Paris.
Features
- Fetch global traffic information on the RATP network.
- Retrieve traffic information for specific lines.
- Get affluence data for journeys on particular lines.
Installation
To use RatpAPI in your project, you can clone this repository:
pip install ratp-api-python
Usage
Setting Up
First, import the RatpAPI
class and initialize it with your API key:
from ratp_api.main import RatpAPI
api = RatpAPI()
Fetching Global Traffic Information
To get global traffic data:
global_traffic = api.get_global_traffic()
print(global_traffic)
Fetching Line-Specific Traffic
To get traffic information for a specific line:
line_traffic = api.get_line_traffic("line_id_here")
print(line_traffic)
Fetching Affluence for Journeys
To get affluence data for a specific journey on a line:
start_coords = (longitude, latitude) # Start location coordinates
end_coords = (longitude, latitude) # End location coordinates
line_id = "line_id_here"
affluence_data = api.get_affluence(start=start_coords, end=end_coords, line_id=line_id)
print(affluence_data)
Fetching Affluence for All Lines
To get affluence data for all lines:
all_lines_affluence = api.get_all_lines_affluence()
print(all_lines_affluence)
Contributing
Contributions to the RatpAPI project are welcomed!
License
This project is licensed under MIT
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
File details
Details for the file ratp_api-1.0.0.tar.gz
.
File metadata
- Download URL: ratp_api-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87411d1953641b8773b072eadc22d995c15615e9059a4e79b60fceb87f2b1fd9 |
|
MD5 | 3b9c75a80273e2e7d89b770a0beb807e |
|
BLAKE2b-256 | df76e6ca2653db66001c4ca1013df0245a682569be44ef6acc0edd5231f9ce55 |
File details
Details for the file ratp_api-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: ratp_api-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 018af822da17bc76b1d0c34faa7bdd87e1baf81acf248efaa0b1cbfe61dd6141 |
|
MD5 | 8ff950c1bbad3a7da71c7107882d6a7e |
|
BLAKE2b-256 | 3e1691fb1a35ad968b84421546994ad4ed900414a003b8a09b680ba135557d25 |