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.6.tar.gz (171.1 kB view details)

Uploaded Source

Built Distribution

fshafas-0.0.6-py3-none-any.whl (210.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fshafas-0.0.6.tar.gz
  • Upload date:
  • Size: 171.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for fshafas-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c79ff62027b2a1f448d01408bdcbecf55c7591f29cc16902ee4f3e96dc4ebb58
MD5 bddf8f69a91c0f577b88ceb603f15cf2
BLAKE2b-256 958c1fe699b5b5e8e1e0a358c619f63e4816ea7fd28f7838575b2827acf22d4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fshafas-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 210.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for fshafas-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0cd8ef3cb3a683d4928ff02eeb332ba2cbc491d1dce874411b097af079e72463
MD5 fc2fa472853c05d9989dd227ed5ca8c4
BLAKE2b-256 438e892e55645d8d5cbec1a617dbf82ba65c1a03f21bc936a240a19133d5c35f

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