- populate_db.py: checks the existence of .bu files in
./assets/bus/
and populates the database with the information in the files. - requirements.txt: list of dependencies for the script to run.
- Download the files transmitted for re-totalization, which contain the information of the BUs, such as those available at: dadosabertos.tse
- Insert the .bu files inside the ./assets/bus/ directory organized into smaller directories with names starting with "bu". For example
- ./assets/bus/bu-ac
- ./assets/bus/bu-sp1
- ./assets/bus/bu-goias
- Run "populate_db.py"
- In terminal:
python3 populate_db.py
- In terminal:
If you don't have the data, you can use the mocked data available in the ./assets/mocked_bus/ directory.
When the script does not find the data in the ./assets/bus/ directory, it will use the data in the ./assets/mocked_bus/ directory.
Thus, to use the mocked data, follow the steps below:
- Run the script "populate_db.py"
- In terminal:
python3 populate_db.py
- In terminal: