ParkAPI icon indicating copy to clipboard operation
ParkAPI copied to clipboard

Add Jena

Open Mola19 opened this issue 2 years ago • 2 comments

Jena has a very comprehensive api, which is split up into several sources. https://opendata.jena.de/dataset/parken

Some files say they are only for testing, but they reflect the data shown on the website https://mobilitaet.jena.de/de/parken

To get all necessary data, two sources are required (one xml file for the current occupancy data and one json file for general parking lot data). This currently doesn't not fit how api works, so one of them is fetched in the code.

Beautiful Soup can't parse the xml file with "html.parser", it needs an actual xml parser (lxml is the only Soup supports), so i added this as a dependency (it requires these apt packages: libxml2-dev libxslt-dev python-dev).

Also since the json api returns all necessary geodata, not much data is needed in the geojson. I can add it though if you want it anyway (there is also a comprehensive geojson file in the api).

I have one question though: the documentation states, that free is an optional field for a lot, but the tests fail if it doesn't exists and if it is None the comparison with total fails. So is it optional or not?

Currently it only takes lots where the free lots are known, but in both cases i would probably restructure the code a bit

Mola19 avatar Jan 01 '24 17:01 Mola19

Dear @Mola19, thank you very much for your contribution. May I direct you to the ParkAPI2-sources project, which will replace ParkAPI in a few weeks. If you don't mind to update the Jena scraper there, this would be great!

Thank you!

And I'll add a note to this project, so others are guided to the new project, also.

hbruch avatar Jan 02 '24 14:01 hbruch

Ok, i opened a pull request there (https://github.com/offenesdresden/ParkAPI/pull/246#issuecomment-1874806882). Should i close this pr?

Mola19 avatar Jan 03 '24 03:01 Mola19