{"id":16271014,"url":"https://github.com/strvm/ratp-api-python","last_synced_at":"2025-04-11T11:40:55.532Z","repository":{"id":217017197,"uuid":"742956853","full_name":"Strvm/ratp-api-python","owner":"Strvm","description":"Python wrapper for the RATP API.","archived":false,"fork":false,"pushed_at":"2024-01-14T23:03:16.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T13:50:09.414Z","etag":null,"topics":["api","metro","ratp","rer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Strvm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-13T21:41:52.000Z","updated_at":"2024-11-26T13:05:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"8e9542fa-33b8-4f34-95a2-4b07aba71281","html_url":"https://github.com/Strvm/ratp-api-python","commit_stats":null,"previous_names":["strvm/ratp-api-python"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strvm%2Fratp-api-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strvm%2Fratp-api-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strvm%2Fratp-api-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Strvm%2Fratp-api-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Strvm","download_url":"https://codeload.github.com/Strvm/ratp-api-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248385418,"owners_count":21094884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","metro","ratp","rer"],"created_at":"2024-10-10T18:12:13.005Z","updated_at":"2025-04-11T11:40:55.506Z","avatar_url":"https://github.com/Strvm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RatpAPI Python Wrapper\n\n## Overview\nRatpAPI 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.\n\n## Features\n- Fetch global traffic information on the RATP network.\n- Retrieve traffic information for specific lines using the `LineID` enum for easy reference.\n- Get affluence data for journeys on particular lines.\n- Utilizes Pydantic models for data validation and parsing.\n\n\n## Installation\nTo use RatpAPI in your project, you can install it via pip:\n```bash\npip install ratp-api-python\n```\n\n## Usage\na\n### Setting Up\nFirst, import the `RatpAPI` class and initialize it with your API key:\n\n```python\nfrom ratp_api.main import RatpAPI\n\napi = RatpAPI()\n```\n\n### Using the LineID Enum\nThe `LineID` enum provides a convenient way to reference specific lines by their IDs:\n```python\nfrom ratp_api.enums import LineID\n\n# Example: Using LineID for RER A\nline_id = LineID.RER_A\n```\n\n### Fetching Global Traffic Information\nTo get global traffic data:\n```python\nglobal_traffic = api.get_global_traffic()\nprint(global_traffic)\n```\n\n### Fetching Line-Specific Traffic\nTo get traffic information for a specific line using the `LineID` enum:\n```python\nline_data = api.get_line_traffic(line_id=LineID.METRO_14)\nfor situation in line_data.situations:\n    print(situation)\n# Output:\n# isActive=True isPlanned=True criticity='HIGH' messages=[\"Jusqu'au 04/02, le week-end, trafic interrompu sur l'ensemble de la ligne en raison de travaux. Bus de remplacement. Plus d'informations sur la page dédiée.\"]\n# isActive=False isPlanned=True criticity='HIGH' messages=[\"Du 01/02 au 08/02, du lundi au jeudi à partir de 22h, trafic interrompu sur l'ensemble de la ligne en raison de travaux. Bus de remplacement. Plus d'informations sur la page dédiée.\"]\n# isActive=False isPlanned=True criticity='HIGH' messages=[\"Jusqu'au 31/01, du lundi au jeudi à partir de 22h, trafic interrompu sur l'ensemble de la ligne en raison de travaux. Bus de remplacement. Plus d'informations sur la page dédiée.\"]\n\n```\n\n### Fetching Affluence for Journeys\nTo get affluence data for a specific journey on a line:\n```python\nline_id = LineID.RER_A          # Using LineID enum\n\naffluence_data = api.get_line_affluence(line_id=line_id)\nprint(affluence_data)\n```\n\n### Fetching Affluence for All Lines\nTo get affluence data for all lines:\n```python\nall_lines_affluence = api.get_all_lines_affluence()\nprint(all_lines_affluence)\n```\n\n## Contributing\nContributions to the RatpAPI project are welcomed!\n\n## License\nThis project is licensed under the MIT License.\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvm%2Fratp-api-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrvm%2Fratp-api-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvm%2Fratp-api-python/lists"}