FahrplanDatenGarten / pyhafas

A python client for the HAFAS (HaCon Fahrplan Auskunfts System)

Home Page:https://pyhafas.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DB CLIENTVERSION error

kilimnik opened this issue · comments

I noticed, that unfortunately, the library integration for the DB Client does not work anymore.
I tried requesting locations and arrivals.
The response from the api is always

{"ver": "1.16", "ext": "DB.R19.04.a", "lang": "deu", "id": "", "err": "CLIENTVERSION", "cInfo": {"code": "VD"}, "svcResL": []}

I am not sure what client version they are referring to

I also noticed a broken connection to Hafas with a slightly different error:

File "hafas.py", line 18, in departures
    abfahrten = client.departures(station=client.locations(start)[0].id,date=datetime.datetime.now(),max_trips=10,products={'long_distance_express':                                                  True,'regional_express': True,'regional': True,'suburban': True,'bus': False,'ferry': False,'subway': False,'tram': False,'taxi': False},direction=                                                 client.locations(ziel)[0].id)
  File "/usr/local/lib/python3.9/dist-packages/pyhafas/client.py", line 188, in locations
    res = self.profile.request(body)
  File "/usr/local/lib/python3.9/dist-packages/pyhafas/profile/base/helper/request.py", line 78, in request
    return HafasResponse(res, BaseErrorCodesMapping)
  File "/usr/local/lib/python3.9/dist-packages/pyhafas/types/hafas_response.py", line 30, in __init__
    self.check_for_errors(mapping)
  File "/usr/local/lib/python3.9/dist-packages/pyhafas/types/hafas_response.py", line 46, in check_for_errors
    raise mapping['default'].value(self.data.get('errTxt', ''))
pyhafas.types.exceptions.GeneralHafasError

commented

Oh yes, same problem as @asraelvudogel here. :(

hi, one of the maintainers of the library here. I'm actually surprised that people want to use pyhafas :) I'll do some work on it and publish a new version soon!

As far as I saw, it's the only python library for hafas.

Yeah I also didn't found another one. Is there a way to display more details on the error? I get the same error sadly...

I'm struggling with reproducing this in my browser as I can't access the API at all atm, I'm trying to work around this, but it's not that easy for proprietary APIs. Sadly in germany GTFS-Realtime isn't very widespread, so I have to use Hafas 😞

It's good, that there is a lib at least - if I´d have to write my own using the information from PTE it would be pretty hard...

After upgrading to v0.3.1 the GeneralHafasError has gone. HaFAS is responding again as expected. Thanks very much :)

As @StefanKahlich already mentioned: @n0emis published a release 0.3.1 fixing the main problem of pyhafas. Still hafas changed over the last 2 years, and pyhafas is also missing some features (e.g. pricing). These will be kept tracked in #20.