Asynchronous Python client for the HERE Routing V8 API
Project description
here_routing
Asynchronous Python client for the HERE Routing V8 API
Installation
pip install here_routing
Usage
import asyncio
from here_routing import HERERoutingApi, Place, Return, TransportMode
API_KEY = "<YOUR_API_KEY>"
async def main() -> None:
"""Show example how to get duration of your route."""
async with HERERoutingApi(api_key=API_KEY) as here_routing:
response = await here_routing.route(
transport_mode=TransportMode.CAR,
origin=Place(latitude=50.12778680095556, longitude=8.582081794738771),
destination=Place(latitude=50.060940891421765, longitude=8.336477279663088),
return_values=[Return.SUMMARY],
)
print(
f"Duration is: {response['routes'][0]['sections'][0]['summary']['duration']}"
)
if __name__ == "__main__":
asyncio.run(main())
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
here_routing-1.0.0.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for here_routing-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31a149d1fc0dc1aeb1f727c82083adfce706fd6fee45e4300e4cbbf459beea3d |
|
MD5 | e2c1992d229b4094a8086473f990de8b |
|
BLAKE2b-256 | 828fb1c0cf3fd21edf6d635c0992816cf3cee7d6ef06191908b794708326315a |