Lovely Rita: Insights from Oakland Citation Data
Lovely Rita is set of tools for reading, cleaning, and saving parking parking citation datasets. The name pays homage to the song, Lovely-Rita, by the Beatles.
With Lovely Rita, you can load historical parking citation data, clean the data (addresses and dates), geocode (turn addresses into geospatial coordinates), and save cleaned data to shapefiles for GIS analyses.
Check out our documentation for more detail.
It is good practice to use a virtual environment.
git clone https://github.com/openoakland/lovely-rita.git cd lovely-rita pip install -r requirements.txt pip install . --user
Raw data format
Raw data should be provided in a .csv with the column names (in any order):
Command line interface
Several useful workflows can be run from the command line. Learn about the available workflows using
lovelyrita --help. Learn about a specific workflow using
lovelyrita <workflow> --help.
There is also a python inferface if you want to dive deeper into the data. There are more involved examples in the notebooks folder.
Read in the data
from lovelyrita.data import read_data citations = read_data(data_path)
Clean the data
Lovely Rita can also clean and parse addresses and dates.
from lovelyrita.data import read_data from lovelyrita.clean import clean citations = read_data(data_path) citations = clean(citations)
Analyze the data
- Number of citations per zip code
- Time-series, number of citations
- Type of violation by zip code
Save the data
There is also support for storing the data to shapefiles
from lovelyrita.data import write_shapefile write_shapefile(citations, 'my-shapefile.shp')
Clone the gh-pages branch
git clone -b gh-pages http://github.com/openoakland/lovely-rita.git lovely-rita-docs
Make changes to docs/source/*.rst in master branch.
Build the docs.
cd docs make html
Docs are built to ../../lovely-rita-docs/html
git add -u git commit -m "docs message" git push origin gh-pages
There will be tests.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
The many wonderful people who helped design and build Lovely Rita (* denote active contributors):
- Robert Gibboni aka
- Andrew Tom aka
- Ricky Boebel aka
- Joanna Jia aka
- Drew Erickson aka
- Slav Sinitsyn aka
This project is licensed under the MIT License - see the license file for details.
We would like to acknowledge the help of Danielle Dai and the Oakland Department of Transportation for providing the data and invaluable guidance for this project.