Skip to main content

A library for working with data submitted to the PDI.

Project description

OpenPDI Build Status code style Thanks

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


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.1.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

openpdi-0.1.1-py2.py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page