Asynchronous Python client for the HERE Transit V8 API
Project description
here_transit
Asynchronous Python client for the HERE Transit V8 API
Installation
pip install here_transit
Usage
import asyncio
from here_transit import HERETransitApi, Place, Return
API_KEY = "<YOUR_API_KEY>"
async def main() -> None:
"""Show example how to get location of your tracker."""
async with HERETransitApi(api_key=API_KEY) as here_transit:
response = await here_transit.route(
origin=Place(latitude=50.12778680095556, longitude=8.582081794738771),
destination=Place(latitude=50.060940891421765, longitude=8.336477279663088),
return_values=[Return.TRAVEL_SUMMARY],
)
print(
f"Duration is: {response['routes'][0]['sections'][0]['travelSummary']['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_transit-1.1.1.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for here_transit-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ccc7c560a192e156f1a4d4ee834c77c30e20e0081598f9a56a86347e8c5777 |
|
MD5 | b2e12cf0911a65575c6d812c9d1d67cd |
|
BLAKE2b-256 | 98ac4b54cf3df50617e43e65a2f7fe27eecd8e258af883b00d3f3a0f4e8e6c27 |