FahrplanDatenGarten / pyhafas

A python client for the HAFAS (HaCon Fahrplan Auskunfts System)
https://pyhafas.readthedocs.io
MIT License
41 stars 15 forks source link

Return Response as friendly public transport JSON #27

Open 1Maxnet1 opened 1 year ago

1Maxnet1 commented 1 year ago

Currently when I print the response of the pyhafas client, I get a according object as defined in the types package. However I would like to retrieve the freindly public transport format JSON of e.g. an journey. Is that already possible (and I overlooked it somehow) or would it be feasible to implement ? I could also offer to submit a PR for that.

1Maxnet1 commented 12 months ago

I just experimented a bit with jsonpickle which seems to be able to do the trick. It serializes object graphs and even allows to deserialize them again. Would this be an option? I guess it makes sense to use an existing library instead of implementing something on our own. However one could also argue, that it makes more sense to keep this in the software, that makes use of pyhafas. Or this this a feature which could fit into pyhafas?