- set your database credentials in
etc/pgsql.env
- set variables in
etc/settings.env
- run scripts from
bin
folderextract_enums.sh
downloads list of administrative unitstransform_enums.sh
transforms the list to a file readable bywget
extract_data.sh
downloads the data for given electiontransform_data.sh
converts downloaded XML files to CSVload_data.sh
loads CSV files into PostgreSQL database
PG*
variables are expected to be defined when running ETL process (etc/pgsql.env
might be a good place to start)etc/settings.env
is automatically sourced when needed during ETL processENUMS_URL
is the administrative units XML/CSV/DBF files locationENUMS_ZIP
defines the location of a downloaded zip fileRESULTS_URL
is the base url of XML election resultsFOREIGN_RESULTS_URL
is the location of XML election results from foreign countriesFOREIGN_RESULTS_REGION_ID
is the id of a region that accumulates the votes coming from foreign countries (has to match theelections.municipality
region_id)
- Bash: GNU Parallel, wget, dbview, gnumeric
- Python
- PostgreSQL