-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HAFAS endpoint #1
Comments
Hi! Does HAFAS include realtime information on delays etc.? |
@akloeckner Proceeeding from
It will for a while; It's being used by the DB Navigator app.
Indeed, I spent ~2 years on and off writing it. There are just many edge cases and little details when talking to HAFAS, which is why I suggested porting from JS to Python, instead of developing from scratch without prior knowledge.
This would indeed be possible:
But:
Nope, sorry, it looks like that neither supports the Node built-ins, nor Web APIs. Is there a Python binding for Node? That would work. Another way would be to use I've only found this Node binding: https://github.com/markfinger/python-nodejs/blob/master/README.md
Because a) |
While I'd love to help, I don't think I'm the right person for the job. It was literally the first time I used python and this would negatively impact the quality of the code which is quite important in larger project.
If you can pinpoint the issue I could try to fix that. I just skimmed through the hafas-client and maybe it has something to do with cancelled stopovers, since I just use it for short connections I might have missed it. Anyways if you can use the JS client or the web version of it I would definitively recommend you to do that. |
If you don't want to rely on the publicly deployed |
@derhuerst, what about this library? https://pypi.org/project/python-bond/1.4/ Using built-ins will always require a separate JS process, though, right? Will the same be true for the Web API? |
Depends on what you mean by "built-ins". I was talking to Node built-ins, which exist in addition to ECMAScript, the standardised language behind JS. |
We would have to a) use Node bindings for Python, or b) build a WebSocket/TPC/sockets-based wrapper, or c) port |
Sounds like the simplest way would be the binding. I'm not so sure though, what that means. But as I understand it, it will mean quite some dependencies on a binary Node runtime. That might become a nightmare to maintain on different systems. But still less fragile than some homebrew socket interface or maintaining (and writing in the first place) two hafas clients. I'm not sure how much I can do about this in the nearest future. But sometimes I have creative moments and I might find a working python library to include your code. If I do, I'll put the result on GitHub and link it here, so you can all comment. And there will be a lot to comment, as Im also no Python expert yet... Last thing to note: I'd really like the short and clean interface of Schiene to remain. Station IDs and the like don't seem too user-friendly to me. |
From what I can tell, Python Node bindings would be quite complex and prone to breaking if one of the two changes. I had already written the WebSockets-based RPC interface for
I obviously won't tell you how to design the API of |
I have published |
fixes crash when querying international connections
Hi! I'm working with the VBB public transport API, which is based on HAFAS. I wrote a JavaScript API client for it.
Deutsche Bahn uses HAFAS as well, so consider using the API instead of parsing a "steaming pile" of HTML. ;)
The text was updated successfully, but these errors were encountered: