https://github.com/datamade/chi-councilmatic
:eyes: keep tabs on Chicago city council
Science Score: 36.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
-
✓Committers with academic emails
1 of 16 committers (6.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
:eyes: keep tabs on Chicago city council
Basic Info
- Host: GitHub
- Owner: datamade
- License: mit
- Language: Java
- Default Branch: main
- Homepage: https://chicago.councilmatic.org/
- Size: 27 MB
Statistics
- Stars: 31
- Watchers: 5
- Forks: 16
- Open Issues: 69
- Releases: 0
Topics
Metadata Files
README.md
👀 Chicago Councilmatic
Chicago Councilmatic tracks all things related to Chicago City Council: the legislation introduced and passed, its various committees and the meetings they hold, and the alders themselves.
You can search and browse legislation from 2011 onwards. Some interesting searches include:
- changes in how properties are zoned
- what the City is paying out in settlements
- committee appointments
- celebrating birthdays?!
Chicago Councilmatic is a free and easy way to access official Chicago City Council information.
Production data and SQLite archive
If you'd like to explore the data for Chicago Councilmatic yourself, we make a SQLite database using Datasette available here: https://puddle.datamade.us/chicago_council. This data is updated nightly.
The data updates for the production instance of this site is done with GitHub actions in the https://github.com/datamade/chicago-council-scrapers repository. Data is also updated nightly.
Setup
These days, we run apps in containers for local development. Prefer to run the app locally? See the legacy setup instructions.
Install OS level dependencies:
Run the application
bash
docker-compose up
Load in the data
Chicago Councilmatic needs to data work properly and the database is quite large (several GB). You can either restore from another database (faster) or scrape the data yourself.
Option 1: Import data from production
If you have existing data, bring down your existing data & volumes
bash
docker-compose down --volumes
spin up just the postgres container. this will initialize your database
bash
docker-compose up postgres
in a new terminal window, shell into the postgres container
bash
docker exec -it CONTAINER_ID /bin/bash
psql -d postgres -U postgres
in the PSQL interpreter, delete the old database
sql
DROP DATABASE chi_councilmatic;
then, exit out of PSQL and the container. while the postgres container is still running, run the heroku pg:pull command to restore the production data to your local database. This will take about an hour.
bash
PGUSER=postgres PGPASSWORD=postgres PGHOST=127.0.0.1 PGPORT=32001 heroku pg:pull DATABASE_URL chi_councilmatic --app chi-councilmatic-production
Option 2: Scrape directly from the source
The docker-compose-scrape.yml file contains a service to scrape Legistar web API and
populate your database with standardized data on the council and its members,
legislation, and events. The default command scrapes all committees and people,
and any events and legislation updated in the last 30 days or scheduled for a
future date.
To import / update everything:
bash
docker-compose -f docker-compose-scrape.yml up
To import / update bills from the past 30 days (window=30):
bash
docker-compose -f docker-compose-scrape.yml run scrapers pupa update --rpm=0 chicago bills window=30
To import / update people:
bash
docker-compose -f docker-compose-scrape.yml run scrapers pupa update --rpm=0 chicago people
To import / update events:
bash
docker-compose -f docker-compose-scrape.yml run scrapers pupa update --rpm=0 chicago events
This may take a few minutes to an hour, depending on the volume of recent updates! Once it's finished, head over to http://localhost:8000 to view your shiny new app!
Optional: Update the search index
If you wish to use search in your local install, add your shiny new data to your
search index with the rebuild_index command from Haystack.
bash
docker-compose run --rm app python manage.py update_index --batch-size=100
Set-up pre-commit
Pre-commit hooks are scripts that run on your local machine before every commit.
We use the pre-commit framework to run code linters and formatters that keep our codebase clean.
To set up Pre-Commit, install the Python package on your local machine using
bash
python -m pip install pre-commit
If you'd rather not install pre-commit globally, create and activate a virtual environment in this repo before running the above command.
Then, run
bash
pre-commit install
to set up the git hooks.
Since hooks are run locally, you can modify which scripts are run before each commit by modifying .pre-commit-config.yaml.
Testing
This app provides a basic set of tests that hit all endpoints for the bills,
people, events, and organizations in your local database and ensure that nothing
breaks. To run them, add some data to your database, as described in
Load in the data, then run pytest via docker-compose.
bash
docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
Team
Original project team
- David Moore - project manager
- Forest Gregg - Open Civic Data (OCD) and Legistar scraping
- Cathy Deng - data models and loading
- Derek Eder - front end
- Eric van Zanten - search and dev ops
Maintenance
Chicago Councilmatic is maintained by the DataMade team.
Errors / Bugs
If something is not behaving intuitively, it is a bug, and should be reported. Report it here: https://github.com/datamade/chi-councilmatic/issues
Copyright
Copyright (c) 2015-2023 Participatory Politics Foundation and DataMade. Released under the MIT License.
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
- Issues event: 2
- Watch event: 10
- Push event: 8
- Pull request event: 3
- Create event: 3
Last Year
- Issues event: 2
- Watch event: 10
- Push event: 8
- Pull request event: 3
- Create event: 3
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Cathy Deng | c****5@g****m | 317 |
| Derek Eder | d****r@g****m | 276 |
| Forest Gregg | f****g@u****u | 186 |
| reginafcompton | r****n@g****m | 61 |
| Eric van Zanten | e****n@g****m | 61 |
| hancush | h****n@g****m | 33 |
| Sarah Murray | S****h@S****l | 9 |
| Jean Cochrane (Lead developer, DataMade) | j****e@d****s | 5 |
| Eric van Zanten | e****c@e****m | 3 |
| Aaron Ogle | a****e@g****m | 1 |
| David Moore | d****m@p****g | 1 |
| Karl Fogel | k****l@r****m | 1 |
| Patrick Connolly | p****y@g****m | 1 |
| cecilia-donnelly | d****1@g****m | 1 |
| Michael Castelle | m****b@p****m | 1 |
| Adam Chainz | a****m@a****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 138
- Total pull requests: 69
- Average time to close issues: 6 months
- Average time to close pull requests: 23 days
- Total issue authors: 6
- Total pull request authors: 5
- Average comments per issue: 1.41
- Average comments per pull request: 0.91
- Merged pull requests: 63
- Bot issues: 1
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: about 2 hours
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- fgregg (78)
- derekeder (32)
- cathydeng (24)
- evz (2)
- saberrg (1)
- sentry-io[bot] (1)
Pull Request Authors
- derekeder (55)
- fgregg (11)
- cecilia-donnelly (1)
- kfogel (1)
- hancush (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- django-councilmatic ==2.5.5
- django-councilmatic-notifications ==2.5.1
- django-debug-toolbar ==1.9.1
- gunicorn ==19.6.0
- pytest ==4.6.2
- pytest-django ==3.5.0
- raven ==6.10.0
- setuptools *
- actions/checkout v1 composite
- python 3.7 build
- mdillon/postgis 11
- chi-councilmatic latest
- elasticsearch 7.14.2
- mdillon/postgis 11
- redis latest