Public | Automated Build

Last pushed: 9 months ago
Short Description
Short description is empty for this repo.
Full Description

Emission events database

Scraper tools for the following databases:

Setup

You will need python, some dependencies, a postgres database and an environmental variable pointing to it and that's it:

export EMISSIONS_DATABASE="postgres://malev@localhost:5432/emission_events"
pip install -r requirements.txt
make setup

And to start the party, you will need to populate the database. So far we have 4 different commands to start working:

python emission_events/manage.py COMMAND

Where command can be:

  • downloadbatch to download a batch of emission events starting with --initial.
  • updateemissions will download 100 emissions from the last one stored in the database. If you run this command daily, you will always have the latest data on your system.
  • updateregulatedentities Regulated Entities don't change too ofter. But from time to time you can check wheather you have a new kid on the block.
  • downloadissuedorders will download the issued orders emited for every regulated entity on your database.

Emission events type

For now, we are only focusing on the following emission events:

  • air-shutdown
  • air-startup
  • emissions-event
  • emissions-event-emergency-resp
  • excess-opacity
  • maintenance

Commands

psql -h 127.0.0.1 -U postgres -p 5433
pg_dump -h 127.0.0.1 -U postgres -p 5433 emissions_project > database.sql
psql emission_events < database.sql

Backup

export EMISSIONS_DATABASE=postgres://malev@localhost/emission_events
phd pg_dump > marcosdb-today.sql

Docker

docker build -t emissions .
EMISSIONS_DATABASE=postgres://malev@localhost:5433/emission_events\
docker run -e EMISSIONS_DATABASE --rm emissions

References

Docker Pull Command
Owner
texastribune
Source Repository