Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eifinger/here_transit
Asynchronous Python client for the HERE Transit V8 API
https://github.com/eifinger/here_transit
aiohttp asyncio here here-maps-api heremaps public-transport python python3 routing transit
Last synced: 3 months ago
JSON representation
Asynchronous Python client for the HERE Transit V8 API
- Host: GitHub
- URL: https://github.com/eifinger/here_transit
- Owner: eifinger
- License: mit
- Created: 2022-07-19T14:56:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-01T07:11:39.000Z (7 months ago)
- Last Synced: 2024-10-13T22:35:17.307Z (4 months ago)
- Topics: aiohttp, asyncio, here, here-maps-api, heremaps, public-transport, python, python3, routing, transit
- Language: Python
- Homepage:
- Size: 87.9 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# here_transit
Asynchronous Python client for the HERE Transit V8 API
[![GitHub Actions](https://github.com/eifinger/here_transit/workflows/CI/badge.svg)](https://github.com/eifinger/here_transit/actions?workflow=CI)
[![PyPi](https://img.shields.io/pypi/v/here_transit.svg)](https://pypi.python.org/pypi/here_transit)
[![PyPi](https://img.shields.io/pypi/l/here_transit.svg)](https://github.com/eifinger/here_transit/blob/master/LICENSE)
[![codecov](https://codecov.io/gh/eifinger/here_transit/branch/master/graph/badge.svg)](https://codecov.io/gh/eifinger/here_transit)
[![Downloads](https://pepy.tech/badge/here_transit)](https://pepy.tech/project/here_transit)## Installation
```bash
pip install here_transit
```## Usage
```python
import asynciofrom here_transit import HERETransitApi, Place, Return
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())
```