Skip to main content

Asynchronous Waze client for calculating routes and travel times.

Project description

pywaze

Asynchronous Waze client for calculating routes and travel times.

Based on WazeRouteCalculator

Installation

pip install pywaze

Usage

#!/usr/bin/env python3

import asyncio
from pywaze import route_calculator


async def get_time(start: str, end: str) -> float:
    """Return the travel time home."""

    async with route_calculator.WazeRouteCalculator() as client:
        results = await client.calc_routes(start, end)
        route_time, _ = list(results.values())[0]
        return route_time


start = "50.00332659227126,8.262322651915843"
end = "50.08414976707619,8.247836017342934"

travel_time = asyncio.run(get_time(start, end))

print(travel_time)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywaze-1.0.1.tar.gz (117.8 kB view hashes)

Uploaded Source

Built Distribution

pywaze-1.0.1-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page