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 traveltimepyVerified import paths — ran on the pinned version, not inferred.
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.
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.
Set environment variables `TRAVELTIME_APP_ID` and `TRAVELTIME_API_KEY` with your actual credentials. Alternatively, pass them directly as keyword arguments to `TravelTimeClient()`.
Always cast latitude and longitude values to `float` before creating `Coords` objects, e.g., `Coords(lat=float(my_lat), lng=float(my_lng))`.