Skip to main content

python client for HAFAS public transport APIs

Project description

FsHafas

Python client for HAFAS public transport APIs.

The python package is generated from Hafas Client in F# with fable-py, a tool that translates F# source files to Python (currently a prerelease).

Related:

Example

Retrieve journeys:

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.

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

fshafas-0.0.13.tar.gz (178.6 kB view details)

Uploaded Source

Built Distribution

fshafas-0.0.13-py3-none-any.whl (227.3 kB view details)

Uploaded Python 3

File details

Details for the file fshafas-0.0.13.tar.gz.

File metadata

  • Download URL: fshafas-0.0.13.tar.gz
  • Upload date:
  • Size: 178.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for fshafas-0.0.13.tar.gz
Algorithm Hash digest
SHA256 aab3e541fbc93a0ada3b4642b4a45cde0142df1abb22a940fd3a6ef684e7d572
MD5 3a5e63a0358492ac10c8c4b2f60253dd
BLAKE2b-256 df8b1a4068d02a96669b41a2579da452da27b0601b8d2b15932a020e77555258

See more details on using hashes here.

File details

Details for the file fshafas-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: fshafas-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 227.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for fshafas-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 088502c2f617ebc48e522aa9346deb28dcb4580c9bd21db472dbc92fd0418c31
MD5 c1d3de980b00a649877d81da7ae8029b
BLAKE2b-256 ea40d8902d845759b6aa858572a70393ca34230b2b9667c726f77fff695e4ceb

See more details on using hashes here.

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