TODO:
- Make devcontainer
- Make test resources/sample tests for xlsx extraction
- Make test resources/sample tests for pdf extraction
- Make schema for final table
- START WITH PREGNANT INMATES
Scrapers, parsers, and loaders for various reports on jails, prisons, and police produced by the government of Texas.
- Pyenv
- Poetry
- To use the local database, you need to install Docker and Docker Compose PLugin following these instructions.
Makefile commands:
make local_dev
: Install poetry environment with dev dependenciesmake local_analytics
: Install analytics dependenciesmake jupyter
: Run a jupyter notebook
Pre-commit hooks are run after each commit to ensure consistent formatting, linting, and use of types.
To run unit tests: make unit_test
Checks run:
- Confirm Black code formatter was run
- Tests/Code Coverage
- Type Checking (TODO)
- Confirm Changelog updated (TODO)
Database migrations are managed by Alembic. The most common commands are included in the Makefile.
make local_db
: Run Docker Compose to create a local version of the database and run all available migrations (Required before all other commands)make migration
: Create a new revision to add/delete tables and columnsmake db_history
: Get a verbose version of the database's migrations so farmake db_up
: Upgrade to the latest migrationmake db_down
: Go back one migrationmake db_query
: Open a psql terminal to query database directly. See command reference.
The up/down commands require a running local database, which can be created by running the docker compose.
https://stackoverflow.com/questions/37694987/connecting-to-postgresql-in-a-docker-container-from-outside
docker exec -it postgres-container psql -U postgres