Registry / http-networking / traveltimepy

traveltimepy

JSON →
library4.6.3pypypi✓ verified 84d ago

Traveltimepy is the official Python client for the Travel Time API, providing functionality to calculate travel times and distances between locations, search reachable areas, and find routes. It supports various transportation modes (driving, cycling, public transport, walking). The current stable version is 4.6.1, with regular updates to keep pace with API features and Python ecosystem changes.

pip install traveltimepy
INSTALL
IMPORT
SIG · TRAVELTIMEPY
T
traveltimepy
http-networkingpythonv4.6.3
Install
9.1s avg
Import
Disk
126MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 10.55s
py 3.11
✓ —
✓ 8.55s
py 3.12
✓ —
✓ 7.15s
py 3.13
✓ —
✓ 7.5s
py 3.9
✕ build_error
✓ 11.95s
126MB installed
● package 126MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from traveltimepy import Client
from traveltimepy import TravelTimeClient
AsyncClient
from traveltimepy import AsyncClient

This quickstart demonstrates how to initialize the `TravelTimeClient`. It relies on environment variables for API authentication. Replace placeholder values or ensure `TRAVELTIME_APP_ID` and `TRAVELTIME_API_KEY` are configured in your environment.

import os from traveltimepy import TravelTimeClient # Initialize the Travel Time API client. # Ensure TRAVELTIME_APP_ID and TRAVELTIME_API_KEY environment variables are set # with your credentials obtained from the Travel Time Platform. client = TravelTimeClient( application_id=os.environ.get('TRAVELTIME_APP_ID', 'your_app_id_here'), api_key=os.environ.get('TRAVELTIME_API_KEY', 'your_api_key_here') ) # The 'client' object is now ready to make API calls, # e.g., client.time_filter(...), client.time_map(...). # For detailed examples, refer to the official documentation or GitHub README.
Debug
Known issues
breakingVersion 4.0.0 of `traveltimepy` introduced a complete rewrite of the SDK. The client initialization, data structures (e.g., Location, Transportation), and method signatures changed significantly.
fix
Users upgrading from v3.x to v4.x must rewrite their code. Review the official migration guide or v4.0.0 release notes. Key changes include `TravelTimeSDK` becoming `TravelTimeClient` and updated parameter objects.
affects: 3.x -> 4.x
gotchaThe API requires both an `application_id` and an `api_key`. Ensure these are correctly provided during client initialization, ideally via environment variables to avoid hardcoding credentials.
fix
Set environment variables `TRAVELTIME_APP_ID` and `TRAVELTIME_API_KEY` with your actual credentials. Alternatively, pass them directly as keyword arguments to `TravelTimeClient()`.
affects: All versions
gotchaWhen using `Coords` objects, ensure `lat` and `lng` are provided as floats. Incorrect data types can lead to `pydantic.ValidationError` or API errors.
fix
Always cast latitude and longitude values to `float` before creating `Coords` objects, e.g., `Coords(lat=float(my_lat), lng=float(my_lng))`.
affects: All versions
Upgrade
Version history
4.6.3latest on PyPI · released May 4, 2026
Audit
Dependencies
pydanticrequiredData validation and settings management
requestsrequiredHTTP client for making API requests
python-dateutilrequiredUtilities for parsing and manipulating dates/times
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
traveltimepy — pip install traveltimepy · libregistry