openpolicedata


Nameopenpolicedata JSON
Version 0.9 PyPI version JSON
download
home_pageNone
SummaryThe OpenPoliceData (OPD) Python library is the most comprehensive centralized public access point for incident-level police data
upload_time2024-11-24 14:09:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseBSD 3-Clause License Copyright (c) 2021, sowdm All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords police data use of force traffic stops complaints officer-involved shootings pandas arcgis socrata police transparency police accountability
VCS
bugtrack_url
requirements sodapy pandas rapidfuzz numpy requests packaging tqdm openpyxl typing-extensions xlrd
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/openpolicedata.svg)](https://badge.fury.io/py/openpolicedata)
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://openpolicedata.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 500+ 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](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html). 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)
```

- Documentation: https://openpolicedata.readthedocs.io/
- Source Code: https://github.com/openpolicedata/openpolicedata
- Bug Tracker: https://github.com/openpolicedata/openpolicedata/issues
- [Latest Datasets](#latest-datasets-added)
- [Release Notes](#release-notes-for-version-057-2023-09-05)
- [Contributing](#contributing)


![alt text](https://github.com/openpolicedata/opd-data/blob/main/OPD_Datasets_Map.png?raw=true)

## Latest Datasets Added to OPD
- California: Stops data for all departments submitted for RIPA for 2018-2022
- Mapping Police Violence police killings
- Washington Post police killings
- Indiana: Officer-Involved Shootings
- Pittsburgh, PA: Complaints, traffic stops, and use of force
- Fort Worth, TX: Traffic stops and use of force
- Yakima County, WA: Use of force
- Washington D.C.: Historical (2010-2017) stops data
- South Bend, IN: Complaints involving administrative investigations
- Tucson, AZ: Added additional years of arrests

## v0.9 - 2024-11-23
### Added
- Added ability to load an Excel file from a zip file containing multiple files
- Adding ability to load multiple CSV files from the same year from a zip file
- Adding ability to handle datasets containing data from multiple states
- Adding ability for CSV files to have a query in the source table to only show relevant police data
- Added minimum Python version to datasets
### Changed
- No longer throwing error if state field is not a known state. Enables multi-state datasets, which will break pre-v0.6 that do not allow for compatibility tables
### Removed
- No longer updating datasets table when data load finds a capitalization error in the date field
### Fixed
- sortby inputs to data loaders now all work
- Fixed issue where input swap checks in Source methods were checking for swaps in the wrong in put.
- Warnings were not being displayed when compatibility source table was being used

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](https://github.com/openpolicedata/openpolicedata/blob/main/CONTRIBUTING.MD) or reach out by [email](mailto:openpolicedata@gmail.com).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "openpolicedata",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "police data, use of force, traffic, stops, complaints, officer-involved, shootings, pandas, arcgis, socrata, police transparency, police accountability",
    "author": null,
    "author_email": "Matt Sowd <openpolicedata@gmail.com>, Paul Otto <potto@ieee.org>",
    "download_url": "https://files.pythonhosted.org/packages/e7/ef/cd70673d6203bb23da8dca8760bd5c0169b26e27fdd487574f1570927623/openpolicedata-0.9.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/openpolicedata.svg)](https://badge.fury.io/py/openpolicedata)\r\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://openpolicedata.streamlit.app)\r\n\r\n# OpenPoliceData\r\nThe 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 500+ incident-level datasets for about 4865 police agencies. Types of data include traffic stops, use of force, officer-involved shootings, and complaints. \r\n\r\nUsers request data by department name and type of data, and the data is returned as a [pandas DataFrame](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html). 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.\r\n\r\nOpenPoliceData can be installed from the Python Package Index (PyPI):\r\n```\r\npip install openpolicedata\r\n``` \r\n\r\nOpenPoliceData provides access to police data with 2 simple lines of code:\r\n```\r\n> import openpolicedata as opd\r\n> src = opd.Source(\"New Orleans\")\r\n> data = src.load(table_type=\"USE OF FORCE\", year=2022)\r\n```\r\n\r\n- Documentation: https://openpolicedata.readthedocs.io/\r\n- Source Code: https://github.com/openpolicedata/openpolicedata\r\n- Bug Tracker: https://github.com/openpolicedata/openpolicedata/issues\r\n- [Latest Datasets](#latest-datasets-added)\r\n- [Release Notes](#release-notes-for-version-057-2023-09-05)\r\n- [Contributing](#contributing)\r\n\r\n\r\n![alt text](https://github.com/openpolicedata/opd-data/blob/main/OPD_Datasets_Map.png?raw=true)\r\n\r\n## Latest Datasets Added to OPD\r\n- California: Stops data for all departments submitted for RIPA for 2018-2022\r\n- Mapping Police Violence police killings\r\n- Washington Post police killings\r\n- Indiana: Officer-Involved Shootings\r\n- Pittsburgh, PA: Complaints, traffic stops, and use of force\r\n- Fort Worth, TX: Traffic stops and use of force\r\n- Yakima County, WA: Use of force\r\n- Washington D.C.: Historical (2010-2017) stops data\r\n- South Bend, IN: Complaints involving administrative investigations\r\n- Tucson, AZ: Added additional years of arrests\r\n\r\n## v0.9 - 2024-11-23\r\n### Added\r\n- Added ability to load an Excel file from a zip file containing multiple files\r\n- Adding ability to load multiple CSV files from the same year from a zip file\r\n- Adding ability to handle datasets containing data from multiple states\r\n- Adding ability for CSV files to have a query in the source table to only show relevant police data\r\n- Added minimum Python version to datasets\r\n### Changed\r\n- No longer throwing error if state field is not a known state. Enables multi-state datasets, which will break pre-v0.6 that do not allow for compatibility tables\r\n### Removed\r\n- No longer updating datasets table when data load finds a capitalization error in the date field\r\n### Fixed\r\n- sortby inputs to data loaders now all work\r\n- Fixed issue where input swap checks in Source methods were checking for swaps in the wrong in put.\r\n- Warnings were not being displayed when compatibility source table was being used\r\n\r\nComplete change log available at: https://github.com/openpolicedata/openpolicedata/blob/main/CHANGELOG.md\r\n\r\n## Contributing\r\nAll 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](https://github.com/openpolicedata/openpolicedata/blob/main/CONTRIBUTING.MD) or reach out by [email](mailto:openpolicedata@gmail.com).\r\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2021, sowdm All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "The OpenPoliceData (OPD) Python library is the most comprehensive centralized public access point for incident-level police data",
    "version": "0.9",
    "project_urls": {
        "documentation": "https://openpolicedata.readthedocs.io/en/stable/documentation.html",
        "homepage": "https://openpolicedata.readthedocs.io/",
        "repository": "https://github.com/openpolicedata/openpolicedata",
        "tracker": "https://github.com/openpolicedata/openpolicedata/issues"
    },
    "split_keywords": [
        "police data",
        " use of force",
        " traffic",
        " stops",
        " complaints",
        " officer-involved",
        " shootings",
        " pandas",
        " arcgis",
        " socrata",
        " police transparency",
        " police accountability"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bfe45110fd40c287d0b99ed259274a027dae1a830fb8b7c303290dc3e77d3d08",
                "md5": "0a92339bc63b5ad98d321ff88acc490f",
                "sha256": "532c8a7ad348b4ccb1ece9477916dfa99b4e297a6177e29bc202ad5fe9b9f461"
            },
            "downloads": -1,
            "filename": "openpolicedata-0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0a92339bc63b5ad98d321ff88acc490f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 121396,
            "upload_time": "2024-11-24T14:08:57",
            "upload_time_iso_8601": "2024-11-24T14:08:57.314172Z",
            "url": "https://files.pythonhosted.org/packages/bf/e4/5110fd40c287d0b99ed259274a027dae1a830fb8b7c303290dc3e77d3d08/openpolicedata-0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7efcd70673d6203bb23da8dca8760bd5c0169b26e27fdd487574f1570927623",
                "md5": "f5ea63d648219322230a376a835905e7",
                "sha256": "62cf7dcc7449f32f122f31eea97293ebe8291e1cc2b87ce201a8877d2ad04a88"
            },
            "downloads": -1,
            "filename": "openpolicedata-0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "f5ea63d648219322230a376a835905e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 151014,
            "upload_time": "2024-11-24T14:09:02",
            "upload_time_iso_8601": "2024-11-24T14:09:02.432174Z",
            "url": "https://files.pythonhosted.org/packages/e7/ef/cd70673d6203bb23da8dca8760bd5c0169b26e27fdd487574f1570927623/openpolicedata-0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-24 14:09:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openpolicedata",
    "github_project": "openpolicedata",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "sodapy",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "<",
                    "3.0.0"
                ],
                [
                    ">=",
                    "2.1"
                ]
            ]
        },
        {
            "name": "rapidfuzz",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "<",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "packaging",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        },
        {
            "name": "openpyxl",
            "specs": []
        },
        {
            "name": "typing-extensions",
            "specs": []
        },
        {
            "name": "xlrd",
            "specs": []
        }
    ],
    "lcname": "openpolicedata"
}
        
Elapsed time: 0.41446s