For Mac or Linux systems, all you should need is Python3. Then, you can run the following:
python3 -m venv venv
. venv/bin/activate
pip3 install -r requirements.txtYou can call your virtual environment something else,
but the ./venv/ directory is already gitignored for this repo.
This project uses SQLite by default, which requires no additional setup, but if you want to use PostgreSQL, you will need to do the following:
- Set up a local PostgreSQL database (actual setup will depend on your OS).
- Start PostgreSQL and create the
nlrb_datadatabase:postgres=# create database nlrb_data; - Set up a user and make it the owner of the
nlrb_datadatabase:postgres=# CREATE USER nlrb WITH PASSWORD 'badpassword';(change the password)postgres=# ALTER DATABASE nlrb_data OWNER TO nlrb;
- Rename
db_config-example.pytodb_config.pyand add your DB username, host, and password.
- Download desired CSV(s) from the NLRB case search website and move them to the
date/case_filesdirectory. - Change to the tasks directory:
$ cd nlrb_data/tasks - cd into each task subdirectory in numerical order and run
makein each:$ cd 00_ingest; make(creates thecases_rawtable)$ cd 01_cases; make(cleans data from thecases_rawtable and inserts into thecasestable)$ cd 02_error_log; make(creates theerror_logtable)$ cd 03_allegations; make(parses raw allegations text for each cases in thecasestable and creates theallegationstable)