Example implementation of the planning application data schema.
This repo demonstrates how to go from schema specification files writen in yaml+mark down to Python classes.
These Python classes aer used to builf a Flask app (using WTForms), a schema validator and a PDF generator.
Python packages and a python virtual environment. Stay in the pipenv shell for the steps below.
cp env_example .env
pipenv shell
pipenv install --devCheck it works by running the unittests-
python -m unittest discoverTo run ETLs or the web app start by creating a settings file which is used as the default when running code locally-
cd settings
cp local_config_template.py local_config_YOURNAME.py
ln -s local_config_YOURNAME.py local_config.pyUpdate the parameters in local_config_YOURNAME.py. Without a map key from Google you'll get an error message and see a greyed out map.
To run the web app-
python web_viewer/app.pyPoint a web browser at http://127.0.0.1:2121 and you should see a list of 'Planning application types'.
The builder package creates a simplified pythonic representation of the planning application data schema. The pythonic representation is a Python module of base schema classes which are intended to be intuative and simple. These classes are ready to be extended or used just like any other Python code in other parts of this project.
The web app is a Flask app that can be used to navigate the planning applications. HTML forms are auto-built on demand from the base schema classes created by builder.
PDFs are also built with the base schema classes.
A Dockerfile builds the web_viewer into deployable container.
The web_viewer uses the schema/planning_application_specification.py included in this repo (i.e. it doesn't build from the external schema specification github repo.
The web_viewer does include dynamic building of PDFs.
Build and run locally-
docker build -t forms-generator .
docker run -p 2121:2121 forms-generatorThe software in this project is open source and covered by the LICENSE file.
Individual datasets copied into this repository may have specific copyright and licensing, otherwise all content and data in this repository is © Crown copyright and available under the terms of the Open Government 3.0 licence.