Socket
Socket
Sign inDemoInstall

fshafas

Package Overview
Dependencies
4
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fshafas

python client for HAFAS public transport APIs


Maintainers
1

Readme

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:

  • hafas-client JavaScript client for HAFAS public transport APIs,
  • FPTF Friendly Public Transport Format,
  • @types/hafas-client Type definitions for hafas-client 5.25.0.

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.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc