Skip to content

Commit

Permalink
bump release to v.0.4.0 CSV mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bdamokos committed Dec 27, 2024
1 parent 1e4a563 commit 033e6f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.1] - 2024-12-27
## [0.4.0] - 2024-12-27

### Added
- Enhanced provider information retrieval:
Expand Down
18 changes: 14 additions & 4 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
pip install mobility-db-api
```

## Authentication
## Authentication (Optional)

The client works in two modes:
1. CSV mode (default): Uses a local CSV catalog with basic provider information
2. API mode: Provides real-time, complete dataset information when an API token is available

To enable API mode:
1. Get your API token from the [Mobility Database](https://database.mobilitydata.org/)
2. Set it as an environment variable:
```bash
Expand All @@ -27,20 +32,25 @@ pip install mobility-db-api
```python
from mobility_db_api import MobilityAPI

# Initialize client (uses environment variable or .env file for token)
# Initialize client
# Without token: Uses CSV mode with basic provider information
# With token: Uses API mode with complete, real-time data
api = MobilityAPI()

# Search for providers
# Search for providers (works in both modes)
providers = api.get_providers_by_country("BE")
print(f"Found {len(providers)} providers")

# Download a dataset
# Download a dataset (works in both modes)
if providers:
dataset_path = api.download_latest_dataset(
providers[0]['id'],
download_dir='downloads'
)
print(f"Dataset downloaded to: {dataset_path}")

# Force CSV mode even if token is available
api = MobilityAPI(force_csv_mode=True)
```

## What's Next?
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mobility-db-api"
version = "0.3.1"
version = "0.4.0"
authors = [
{ name="Bence Damokos" }
]
Expand Down

0 comments on commit 033e6f6

Please sign in to comment.