Open derhuerst opened 4 years ago
I can see that you started writing a separate Python lib: pyhafas
.
Even though this is another project that needs to keep up with the constant stream of changes of HAFAS endpoints, IMHO it is worth it to let Python projects access HAFAS data in a reliable & future-proof way. 🎉
There are lots of hidden pitfalls with HAFAS systems, and many reasons why the hafas-client
repo has the structure that it currently has. I'd like to share them and collaborate with you!
There are now 4/5 projects that try to become general-purpose "access layers" to HAFAS:
public-transport-enabler
– oldest project, written in Java, core behind the Öffi Android app; covers HAFAS & non-HAFAS endpoints, but doesn't support many HAFAS featuresTripKit
– recent project, written in Swift, core behind the ÖPNV Navigator iOS appmarudor.de
– written in Typescript, tightly coupled with its HTTP API & website; Deutsche-Bahn-focused, combines multiple APIs, supports many HAFAS featureskpublictransport
– written in C++, fetches public transport data for KDE Itinerary; aims for worldwide coverage, HAFAS is one of its backendshafas-client
– written in JavaScript, medium-aged; used by many other public-transport libraries that I wrote; supports only HAFAS systems, but many of their featuresoeffisear.ch
– written in Nim; limited nr of features, support for >1 HAFAS endpoint plannedpyhafas
– written in Python; limited nr of features, support for >1 HAFAS endpointTo the first question: There is a deployment on https://fahrplandatengarten.de, but it's WIP The second question is @n0emis task
Hey, just came across your project. Is it deployed somewhere to check it out?
db-hafas
is a JavaScript client for the Deutsche Bahnmgate.exe
API. Based onhafas-client
, it has been used for years in several apps, supports many HAFAS features, and – most importantly – covers many edge cases.In https://github.com/kennell/schiene/issues/1#issuecomment-445468008, we've discussed on how you can use it with a language other than JS: spawn
hafas-client-rpc
with thestdin
/stdout
transport and send JSON-RPC from your Python code.I'm aware that using a lib with another runtime (Node.js) is somewhat ugly, but given a complex, barely documented and ever-evolving system like HAFAS, we should try not to re-implement HAFAS clients everywhere.