A Python client for the Mobility Database API
Project description
Mobility Database API Client
A Python client for downloading GTFS files through the Mobility Database API.
Features
- Search for GTFS providers by country, name or id
- Download GTFS datasets from hosted or direct sources
- Track dataset metadata and changes
- Thread-safe and process-safe operations
- Automatic token refresh and error handling
Installation
pip install mobility-db-api
Quick Example
from mobility_db_api import MobilityAPI
# Initialize client (uses MOBILITY_API_REFRESH_TOKEN env var)
api = MobilityAPI()
# Search for providers in Belgium
providers = api.get_providers_by_country("BE")
print(f"Found {len(providers)} providers")
# Download a dataset
if providers:
dataset_path = api.download_latest_dataset(providers[0]['id'])
print(f"Dataset downloaded to: {dataset_path}")
Documentation
Full documentation is available at bdamokos.github.io/mobility-db-api, including:
Development
# Clone repository
git clone https://github.com/bdamokos/mobility-db-api.git
cd mobility-db-api
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Mobility Database for providing the API
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 mobility_db_api-0.5.1.tar.gz.
File metadata
- Download URL: mobility_db_api-0.5.1.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a6fc70d4af1d5793ea0b7ad775b7932f22773bd311c6353d1f0045ed0df2622
|
|
| MD5 |
c7b61594248f48e572ebbc4ed2979654
|
|
| BLAKE2b-256 |
7ff91706ded2986b0fdf015717305dd7f358bf5652ea75141264216927a61374
|
File details
Details for the file mobility_db_api-0.5.1-py3-none-any.whl.
File metadata
- Download URL: mobility_db_api-0.5.1-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0feddbe1ebecc85be00fd7563777e8ad3b908a61d3468c363f419dd988d7b003
|
|
| MD5 |
cb82393c34238fe21f5a9ecba98229fc
|
|
| BLAKE2b-256 |
1ef27e6a319aebeae0046868f6ff67eb731e49edee644d0fb9dae0c2a6031d9d
|