Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 isNone
the comparison withtotal
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