https://github.com/datamade/bga-payroll
💰 How much do your public officials make?
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.6%) to scientific vocabulary
Keywords
Repository
💰 How much do your public officials make?
Basic Info
- Host: GitHub
- Owner: datamade
- Language: JavaScript
- Default Branch: master
- Size: 105 MB
Statistics
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 89
- Releases: 0
Topics
Metadata Files
README.md
💰 bga-payroll
How much do your public officials make?
Running the app locally
Requirements
- 🐳 Docker
Getting started
Perform the following steps from your terminal.
Clone this repository and cd into your local copy.
bash
git clone https://github.com/datamade/bga-payroll.git
cd bga-payroll
Next, copy bga_database/local_settings.py.example from bga_database/local-settings.py.
bash
cp bga_database/local-settings.example.py bga_database/local-settings.py
Finally, build and run the applicaton.
bash
docker-compose up -d --build
Once the command exits, you can visit the app in your browser at http://localhost:8000.
To view logs for app, worker, or any of the other services defined in
docker-compose.yml, run docker-compose logs -f <SERVICE_NAME>, e.g.,
docker-compose logs -f app.
Adding data
The application will work without data, but if you'd like to add some, you have two options: Restore from a database dump, or create and upload a data file.
Restore from a database dump
DataMaders can make or request a dump of the staging database in the #bga-payroll Slack channel.
To create a dump, you must have SSH access to the staging server. Provided that's true, run the following command in your terminal, swapping in the correct value for ${STAGING_URL}:
bash
ssh ubuntu@${STAGING_URL} pg_dump -U postgres -Fc -O -d bga_payroll -h ${RDS_URL} > bga_payroll.dump
When restoring a database, it's important that your local database is empty. So, remove your data volumes prior to restoring.
bash
docker-compose down --volumes
Then, bring your database service up. This will create the bga_payroll database.
bash
docker-compose up postgres
When your database is ready, you'll see output like this:
bash
bga-payroll-postgres | PostgreSQL init process complete; ready for start up.
bga-payroll-postgres |
bga-payroll-postgres | 2021-08-18 16:31:36.869 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
bga-payroll-postgres | 2021-08-18 16:31:36.869 UTC [1] LOG: listening on IPv6 address "::", port 5432
bga-payroll-postgres | 2021-08-18 16:31:36.873 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
bga-payroll-postgres | 2021-08-18 16:31:36.890 UTC [75] LOG: database system was shut down at 2021-08-18 16:31:36 UTC
bga-payroll-postgres | 2021-08-18 16:31:36.895 UTC [1] LOG: database system is ready to accept connections
In a separate terminal window, run pg_restore to load your dump into your containerized database.
docker exec -i bga-payroll-postgres pg_restore -U postgres -Fc -O -v -d bga_payroll < bga_payroll.dump
Finally, start the app:
bash
docker-compose up
N.b., if you need search for development, you also need to build the search index. This command will add employers from 2018 to the index. Add people to the entity types argument, if you need to.
bash
docker-compose exec app python manage.py build_solr_index --reporting_year 2018 --entity-types units,departments --chunksize=25
Upload a data file
First, make a formatted data file in the data/raw folder.
- The file should have a name like payroll-actual-*.csv
- The data should have these columns in this order:
employer,last_name,first_name,title,department,base_salary,extra_pay,date_started,id,year
data/raw/payroll-actual-2017-pt-1.csv
bash
docker-compose exec app make import/payroll-actual-2017-pt-1.csv
This will process and import the file data/raw/payroll-actual-2017-pt-1.csv. So to add data, first put the new data in that directory with that naming convention.
Owner
- Name: datamade
- Login: datamade
- Kind: organization
- Email: info@datamade.us
- Location: Chicago, IL
- Website: http://datamade.us
- Twitter: datamadeco
- Repositories: 123
- Profile: https://github.com/datamade
We build open source technology using open data to empower journalists, researchers, governments and advocacy organizations.
GitHub Events
Total
- Delete event: 1
- Issue comment event: 2
- Push event: 9
- Pull request review event: 1
- Pull request event: 7
- Create event: 2
Last Year
- Delete event: 1
- Issue comment event: 2
- Push event: 9
- Pull request review event: 1
- Pull request event: 7
- Create event: 2
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 137
- Total pull requests: 70
- Average time to close issues: 4 months
- Average time to close pull requests: 15 days
- Total issue authors: 6
- Total pull request authors: 8
- Average comments per issue: 1.31
- Average comments per pull request: 0.94
- Merged pull requests: 63
- Bot issues: 1
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 7
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Issue authors: 0
- Pull request authors: 3
- Average comments per issue: 0
- Average comments per pull request: 0.57
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- hancush (94)
- fgregg (28)
- deraj1013 (7)
- xmedr (6)
- smcalilly (1)
- sentry-io[bot] (1)
Pull Request Authors
- hancush (33)
- smcalilly (15)
- xmedr (8)
- bga-admin (5)
- fgregg (5)
- reliablerascal (2)
- abigailblachman (2)
- phjudge (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- Django ==2.2.9
- attrs ==19.1.0
- bleach *
- boto ==2.48.0
- boto3 ==1.16.63
- cchardet ==2.1.1
- celery ==4.2.1
- census ==0.8.7
- csvkit ==1.0.3
- django-debug-toolbar ==1.9.1
- django-extra-settings ==0.1.1
- django-fsm ==2.6.0
- django-pgviews ==0.5.7
- django-postgres-stats ==1.0.0
- django-storages ==1.6.5
- djangorestframework ==3.11.0
- feedparser ==5.2.1
- gunicorn ==19.7.1
- inflect ==1.0.1
- jinja2 ==2.10.1
- kombu ==4.3.0
- locustio ==0.9.0
- lxml ==4.2.1
- numpy ==1.14.1
- psycopg2-binary ==2.7.4
- pysolr ==3.7.0
- pytest ==3.4.1
- pytest-django ==3.1.2
- pytest-mock ==1.7.1
- python-dateutil ==2.8.1
- redis >=2.10.5,<3
- saferedisqueue ==3.0.0
- sentry-sdk ==0.5.1
- us ==1.0.0
- actions/checkout v2 composite
- actions/setup-python v2 composite
- aws-actions/configure-aws-credentials v1 composite
- webfactory/create-aws-codedeploy-deployment 0d7a684950dae16883a140dd950257958730e0b5 composite
- postgres 10 docker
- redis * docker
- docker/build-push-action v2 composite
- docker/login-action v1 composite
- python 3.5-slim build
- postgres 10
- redis latest
- solr 7.1
- ghcr.io/datamade/bga-payroll latest
- postgres 10
- redis latest
- solr 7.1