Library for working with street parking data using the CurbLR data standard.
PyCurb is currently in development and must be installed locally.
PyCurb Key Features:
- Read and write CurbLR JSON data
- Construct new CurbLR Features in code
- Construct valid CurbLR time rules
We can read a CurbLR geojson feature collection from a file with:
import pycurb
features = pycurb.FeatureCollection.from_file("path/to/curblr.json")We can construct objects that extend pycurb.PyCurbObject from a Python dict with the from_dict method:
import pycurb
time_span_dict = {"timesOfDay": [{"from": "08:00", "to": "18:00"}]}
time_span = pycurb.TimeSpan.from_dict(time_span_dict)We can write a CurbLR geojson feature collection to a json file:
import pycurb
features = pycurb.FeatureCollection()
features.save("./path/to/curblr.json", add_timestamp=True)We can write objects that extends pycurb.PyCurbObject to a Python dict with the to_dict method:
import pycurb
time_of_day = pycurb.time_rule.TimeOfDay("12", "14")
time_of_day.to_dict()Install all dependencies in requirements-dev.txt:
If necessary, create an isolated Python development environment with venv or Docker.
pip install -r requirements-dev.txtTo run the unit test suite and code quality checks:
./scripts/testThese checks are run in CI on the master branch and for all pull requests.
pycurb uses the following development libraries:
unittestfor testingcoveragefor code coverage reportsflake8for lintingyapffor auto formatting