Import DMAP data into a PostgreSQL database
- Install ASDF, Python3, Postgres
brew install asdf
brew install python3
brew install postgresql
- run
asdf install
to install tools via asdf - run
poetry install
to install python dependencies - run
cp .env.template .env
and fill out any missing environment variables - run
docker-compose build
to build the docker images for local testing- run
docker-compose up dmap_local_rds
to stand up a local postgres db- this imnage could be used when running pytest
- run
docker-compose up dmap_import
to run the importer application
- run
- Navigate to repository directory.
- Update
.env
variable. Source itsource .env
. - Run
poetry run start
to run the ingestion process. - Run
psql postgresql://postgres:postgres@127.0.0.1:5432/dmap_importer
to get into the database. Alternatively, afterdocker-compose up
, you can:docker exec -it dmap_local_rds bash
psql -U postgres -d dmap_importer
- Run format, type and lint checker:
poetry run black .
poetry run mypy .
poetry run pylint src tests
- Run tests,
poetry run pytest
.
To create new migration:
alembic revision -m "adding a new column"
# [optional] rename generated file so as to sort migrations by name by prepending '0xx_'