A library for working with data submitted to the PDI.
Project description
OpenPDI
OpenPDI is an unofficial effort to document and standardize data submitted to the Police Data Initiative (PDI). The goal is to make the data more accessible by addressing a number of issues related to a lack of standardization—namely,
- File types: While some agencies make use if the Socrata Open Data API, many provide their data in raw CSV or xlsx/xlsm files of varying structures.
- Column names: Many columns that represent the same data (e.g., the race police officer) are named differently across departments, cities, and states.
- Value formats: Dates, times, and other comparable fields are submitted in many different formats.
- Column availability: It's currently very difficult to identify data sources that contain certain columns—e.g., Use of Force data specifying the hire date of the involved officer(s).
You can learn more by reading the project's mission statement, API docs, or Wiki.
Getting Started
Installation
$ pip install openpdi
Usage
>>> import openpdi
# Find all data Use of Force datasets with a 'hire_date' column.
>>> dataset = openpdi.Dataset('uof', columns=['hire_date'])
>>> dataset.agencies
...
>>> gen = dataset.download()
# `gen` is a generator object for iterating over the CSV-formatted
# dataset.
>>> next(gen) # The headers
...
See the API docs for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openpdi-0.1.0.tar.gz
(11.8 kB
view hashes)
Built Distribution
Close
Hashes for openpdi-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b818c3fec69e0d50a7d70c92e70f99bc2a880f57b706b1e3f39f65cb3291612a |
|
MD5 | 1bf46434546acbeba2a063c0ed593763 |
|
BLAKE2b-256 | 8581532d9d3920d6cbdf87364920bf5306b315494e978545d28dadf27f332935 |