colouring-montreal/etl/planning_data
Mateusz Konieczny 9c19ad24ba one more status
2022-10-05 19:54:39 +02:00
..
.gitignore Display official planning data. 2022-10-05 19:52:14 +02:00
load_into_database_dropped_data.py import of recovered data - maybe it should be done differently 2022-10-05 19:52:45 +02:00
load_into_database.py one more status 2022-10-05 19:54:39 +02:00
make_query.py Display official planning data. 2022-10-05 19:52:14 +02:00
obtain_livestream_data.py Fix time zone to London 2022-10-05 19:52:45 +02:00
README.MD fix mismatch in documentation 2022-10-05 19:54:39 +02:00
recovered.geojson import of recovered data - maybe it should be done differently 2022-10-05 19:52:45 +02:00

Following scripts should be scheduled to run regularly to load livestream data into database.

# querying API to obtain data
python3 obtain_livestream_data.py > all_data.json

# loading data into Colouring database
python3 load_into_database

# removing tile cache for planning_applications_status layer - note that location of cache depends on your configuration
rm /srv/colouring-london/tilecache/planning_applications_status/* -rf

As loading into databases expects environment variables to be set, one option to actually schedule it in a cron is something like

export $(cat ~/scripts/.env | xargs) && /usr/bin/python3 ~/colouring-london/etl/planning_data/load_into_database.py

with

~/scripts/.env

being in following format

PGHOST=localhost
PGDATABASE=colouringlondondb
PGUSER=cldbadmin
PGPASSWORD=actualpassword