Skip to main content

The OpenPoliceData (OPD) Python library is the most comprehensive centralized public access point for incident-level police data in the United States. OPD provides easy access to 425+ incident-level datasets for about 4865 police agencies. Types of data include traffic stops, use of force, officer-involved shootings, and complaints.

Project description

PyPI version Streamlit App

OpenPoliceData

The OpenPoliceData (OPD) Python library is the most comprehensive centralized public access point for incident-level police data in the United States. OPD provides easy access to 425+ incident-level datasets for about 4865 police agencies. Types of data include traffic stops, use of force, officer-involved shootings, and complaints.

Users request data by department name and type of data, and the data is returned as a pandas DataFrame. There is no need to manually find the data online or to know how to work with open data APIs (ArcGIS, Socrata, etc.). When data is loaded by OPD, the returned data is unmodified (with the exception of formatting known date fields) from what appears on the source's site, and OPD provides links to the original data for transparency.

OpenPoliceData can be installed from the Python Package Index (PyPI):

pip install openpolicedata

OpenPoliceData provides access to police data with 2 simple lines of code:

> import openpolicedata as opd
> src = opd.Source("New Orleans")
> data = src.load(table_type="USE OF FORCE", year=2022)

NEW STARTING IN VERSION 0.6: OPD now provides tools for automated data standardization. Applying these tools allow you to start your analysis more quickly by replacing column names and data with standard values for some common column types. Learn how it works and how to use it here.

alt text

Latest Datasets Added to OPD

  • Washington D.C.: Historical (2010-2017) stops data
  • South Bend, IN: Complaints involving administrative investigations
  • Tucson, AZ: Added additional years of arrests
  • Sacramento, CA: Calls for service and citations
  • Cedar Lake, IN: Arrests, calls for service, and citations data
  • Griffith, IN: Arrests, calls for service, and citations data
  • Austin, TX: Arrests, incidents, searches, use of force, and warnings
  • New York, NY: Latest pedestrian stops dataset
  • Chicago, IL: Latest pedestrian stops dataset
  • Washington D.C.: Latest use of force dataset

v0.8.1 - 2024-09-02

Fixed

  • Fixed bug in get_count function for CSV files where count was wrong if there were quotes containing new line characters

v0.8 - 2024-08-24

Added

  • Added data loader for HTML tables

Changed

  • Changed error messages so that more errors in data loading point the user to the list of data site outages

Fixed

  • Fixed bug in CKAN data loader when user requests a range of years

Complete change log available at: https://github.com/openpolicedata/openpolicedata/blob/main/CHANGELOG.md

Contributing

All contributions are welcome including code enhancments, bug fixes, bug reports, documentation updates, and locating new datasets. If you're interesting in helping out, see our Contributing Guide or reach out by email.

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

openpolicedata-0.8.1.tar.gz (142.2 kB view details)

Uploaded Source

Built Distribution

openpolicedata-0.8.1-py3-none-any.whl (116.6 kB view details)

Uploaded Python 3

File details

Details for the file openpolicedata-0.8.1.tar.gz.

File metadata

  • Download URL: openpolicedata-0.8.1.tar.gz
  • Upload date:
  • Size: 142.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for openpolicedata-0.8.1.tar.gz
Algorithm Hash digest
SHA256 30b9691da960f780a97633a26bc40a88a0af54144c3c09a670d54a7234926f94
MD5 9bb5d7831fc274665939ad7801bf3d9d
BLAKE2b-256 327c814c3d9b756f3ec07c4365f2f3f550fa688d006844fa4cc81d7cd0374359

See more details on using hashes here.

File details

Details for the file openpolicedata-0.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openpolicedata-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b4199c2100db70277e766459a182a54dda2ec70dfcfa813baf82bcb58f7943b
MD5 90eb964601f6af79d1057889a7e7ca76
BLAKE2b-256 821985b13e4e162e38af863f7b3cf0655fea1be4cb53341be1081348b7809432

See more details on using hashes here.

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