Skip to content

Tool for parsing US Federal legislation and displaying the proposed changes.

License

Notifications You must be signed in to change notification settings

Congress-Dev/congress-dev

Repository files navigation

congress dot dev forthebadge forthebadge forthebadge


Setup

Required Software

Docker >= 19.0

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. https://docs.docker.com/install/

Docker-Compose >= 1.24

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application's services. https://docs.docker.com/compose/install/


Usage

Basic usage - To start an entirely local copy. This will come with an empty database, you'll have to follow the instructions to populate it (or load the provided backup).

docker-compose -f .docker/docker-compose.yml up -d

Advance Usage - If you rename docker-compose.local-example.yml to docker-compose.local.yml you can run this script to use our API instead of running the database yourself.

chmod  x ./start_local.sh
sh ./start_local.sh

Loading the database

From the backend folder, you will need to tell it to parse some files before you can view them. importers.releases will load 1 release point from the US Code website. ~10MB compressed and put it into the database ~500MB in the db.

docker exec -it docker_parser_api bash

python3 -m billparser.importers.releases rp.json
python3 -m billparser.importers.bills bills.json

A semi up to date postgres dump is available for download.

Assuming you're running the normal docker-compose and an empty database named us_code, you can run this to restore from the backup.

pg_restore -h localhost -U parser -d us_code -F C us_code_beta.backup

Contributing

Please note we have a code of conduct, please follow it in all your interactions with the project.