fshafas-0.0.6
توضیحات
python client for HAFAS public transport APIs
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fshafas-0.0.6 |
| نام | fshafas |
| نسخه کتابخانه | 0.0.6 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Jürgen Bergmann |
| ایمیل نویسنده | jbergmann@posteo.de |
| آدرس صفحه اصلی | https://github.com/bergmannjg/fshafas |
| آدرس اینترنتی | https://pypi.org/project/fshafas/ |
| مجوز | MIT |
# FsHafas
Python client for [HAFAS](https://de.wikipedia.org/wiki/HAFAS) public transport APIs.
The python package is generated from [Hafas Client in F#](https://github.com/bergmannjg/fshafas/tree) with [fable-py](https://www.nuget.org/packages/fable-py/), a tool that translates F# source files to Python (currently a prerelease).
Related:
* [hafas-client](https://github.com/public-transport/hafas-client) JavaScript client for HAFAS public transport APIs,
* [FPTF](https://github.com/public-transport/friendly-public-transport-format) Friendly Public Transport Format,
* [@types/hafas-client](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/743f4c8d5d8af49dfb635a31a8720f7bde5b823f/types/hafas-client/index.d.ts) Type definitions for hafas-client 5.25.0.
## Example
Retrieve journeys:
```py
import asyncio
import sys
from fshafas.fable_modules.fs_hafas_profiles_python.db.profile import profile
from fshafas.hafas_client import HafasClient
async def main(argv) -> int:
with HafasClient(profile) as client:
journeys = await client.journeys(argv[0], argv[1])
for j in journeys.journeys:
for l in j.legs:
print(l.origin.name, l.destination.name, l.departure)
return 0
if __name__ == "__main__":
asyncio.run(main(sys.argv[1:]))
```
The class `HafasClient` corresponds to the Javascript [HafasClient interface](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/fb785106d6264285d452e2e7efb5c68c0639fbd8/types/hafas-client/index.d.ts#L1006).
نیازمندی
| مقدار | نام |
|---|---|
| - | requests |
| - | python-slugify |
| - | polyline |
| - | jsonpickle |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl fshafas-0.0.6:
pip install fshafas-0.0.6.whl
نصب پکیج tar.gz fshafas-0.0.6:
pip install fshafas-0.0.6.tar.gz