FahrplanDatenGarten / FahrplanDatenGarten

https://fahrplandatengarten.de
MIT License
22 stars 3 forks source link

shameless plug: use db-hafas JavaScript lib #12

Open derhuerst opened 4 years ago

derhuerst commented 4 years ago

Hey, just came across your project. Is it deployed somewhere to check it out?

db-hafas is a JavaScript client for the Deutsche Bahn mgate.exe API. Based on hafas-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 the stdin/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.

derhuerst commented 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:

leona-ya commented 4 years ago

To the first question: There is a deployment on https://fahrplandatengarten.de, but it's WIP The second question is @n0emis task

derhuerst commented 4 years ago

https://community.kde.org/KDE_PIM/KPublicTransport/Endpoint_Configuration