Skip to main content

navitia-client

Pre-release Build Status Release Build Status Python Version

This repository provides a unofficial Python wrapper to use navitia.io APIs.

⚠️ Version 2.0.0 Breaking Changes

Version 2.0.0 introduces breaking changes with the adoption of Request objects for all API methods. If you're upgrading from v1.x, please see the CHANGELOG for the migration guide.

Pre-requisites

To use this library, you will need an access token from navitia.io.

 Installation

The package is available on PiPy

pip install python-navitia-client

 API support

The library supports the following APIs:

API Supported ? Comment
Coverage ✅
Datasets ✅
Contributors ✅
Inverted geocoding ✅
Public transportation Objects exploration ✅
Autocomplete on Public Transport objects ✅
Autocomplete on geographical objects ✅
Places nearby ✅
Journeys ✅
Isochrones ✅
Route Schedules ✅
Stop Schedules ✅
Terminus Schedules ✅
Departures ✅
Arrivals ✅
Line reports ✅
Traffic reports ✅
Equipment reports ✅ Not available to all providers
Freefloating nearby ✅ Not available to all providers

Usage

To use this library, you need an authentication token provided by Navitia.io.

Create client instance

Create an instance of the NavitiaClient class with your authentication token:

from navitia_client import NavitiaClient

client = NavitiaClient(auth="YOUR_TOKEN_HERE")

A base URL for Navitia IO is hardcoded and provided to NavitiaClient by default. It can be updated using the base_navitia_url parameter.

Access APIs data

URLs are mapped as properties in the NavitiaClient class. You can find the mapping here.

Simple APIs (Coverage, Datasets, Contributors)

For simple APIs like coverage, datasets, and contributors, you can call methods directly:

# Get coverage information
regions = client.coverage.list_coverage_regions()

# Get datasets for a region
datasets, pagination = client.datasets.list_datasets(region_id="fr-idf")

APIs with Request Objects (Journeys, Places, Schedules, etc.)

Most APIs now use Request objects for better type safety and maintainability:

from navitia_client.entities.request.journey import JourneyRequest
from datetime import datetime

# Create a journey request
request = JourneyRequest(
    from_="stop_area:RAT:SA:GDLYO",
    to_="stop_area:RAT:SA:CHDEG",
    datetime_=datetime(2024, 6, 1, 8, 0),
    count=5
)

# Get journeys
journeys = client.journeys.list_journeys(request=request)

Other examples:

from navitia_client.entities.request.places_nearby import PlacesNearbyRequest

# Places nearby with custom parameters
request = PlacesNearbyRequest(
    distance=1000,
    type=["stop_area", "stop_point"],
    count=20
)
places, pagination = client.places_nearby.list_objects_by_region_id_and_path(
    region_id="fr-idf",
    resource_path="lines/line:RAT:M1",
    request=request
)

Pagination

Several APIs are paginated, particularly the public transportation APIs. You can navigate through results using the start_page and count parameters in Request objects:

from navitia_client.entities.request.journey import JourneyRequest

# Request with pagination
request = JourneyRequest(
    from_="stop_area:RAT:SA:GDLYO",
    to_="stop_area:RAT:SA:CHDEG",
    start_page=0,  # First page
    count=10       # 10 results per page
)

journeys = client.journeys.list_journeys(request=request)

A Pagination object is provided by paginated methods to help you navigate through results.

Tips

Few tips on how to use the Navitia APIs are available here.

 Dependencies

  • Python >= 3.12
  • requests>=2.33

Additional dependencies are described in the pyproject.toml file.

 Contributing

You are free to contribute to the repo. Please read Contributing.md.

 Additional questions

  • Are you affiliated with Navitia ? No. This is an unofficial wrapper for the Navitia.io APIs.

  • Is this client asynchronous ? No, and it is not planned to. If you want to add async support, feel free to contribute.

  • Is this client production ready ? Yes and no. For my own purpose, it is, but I cannot guarantee that everything will behave well. If you spot a bug, please open an issue in the repo.

Metadata

Release files for python-navitia-client 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-navitia-client 3.0.1
File Size Uploaded
python_navitia_client-3.0.1.tar.gz 39.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-navitia-client 3.0.1
File Interpreter ABI Platform
python_navitia_client-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 132.4 kB

Release files / python_navitia_client-3.0.1.tar.gz

Download URL python_navitia_client-3.0.1.tar.gz
Size 39.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b83ee94264bd7ed5ecac55d30cab5f8d846cc328a6f1491c260ade0b6dc58ebe
BLAKE2b-256 checksum
How to use checksums
024ecbd4c46cc73f4b4bdf28a4264d32d10b0deb6251e6cab8d5acfb3ef2ff37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.

Transparency log

Release files / python_navitia_client-3.0.1-py3-none-any.whl

Download URL python_navitia_client-3.0.1-py3-none-any.whl
Size 93.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f525d95d6700298f3401409e76d4099a5cb0e11bb028cf4b6a6cb1fa77bb5e34
BLAKE2b-256 checksum
How to use checksums
9ab43b11e66b740a02047914739905e671086e08912104405d254f0b22051160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

3.0.0

2 release files

2.0.2

2 release files

2.0.0

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.0

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page