This repository is a little manual on how to access London Police Data in a more user-friendly way than downloading separate CSV files. Note that this offers data only for London even though the portal offers data for the whole country.
The dataset contains the following information for each crime that happened in London:
- Month and year
- Latitude, Longitude
- Short description
- Crime type
The mapping below is important when passing arguments to the scripts in this package. The CSV downloaded from the police website uses the names as in the second column of the below table. When using these scripts, whenever a crime type is required please use the first column of the table.
Internal name | Official data.police.uk name |
---|---|
theft-from-person | Theft from the person |
vehicle-crime | Vehicle crime |
shoplifting | Shoplifting |
violence-sexual-offences | Violence and sexual offences |
anti-social-behaviour | Anti-social behaviour |
burglary | Burglary |
robbery | Robbery |
criminal-damage-arson | Criminal damage and arson |
other-theft | Other theft |
possession-weapons | Possession of weapons |
other-crime | Other crime |
public-order | Public order |
drugs | Drugs |
bicycle-theft | Bicycle theft |
violent-crime | Violent crime |
public-disorder-weapons | Public disorder and weapons |
- Download the dataset from Kaggle as
crime.db
file. - Either use SQLite directly by loading
crime.db
that you downloaded in step 1, or use the provided python scripts to generate CSV files for a specific time interval and for specific crime types.
python3 -m crimeretriever.command getcsv --dbfile ./crime.db --startdate 2015-01-01 --enddate 2015-01-31 --crimetypes burglary theft-from-person --outfile 'export.csv'
The columns in the generated CSV are:
INDEX, MONTH, LATITUDE, LONGITUDE, DESCRIPTION, CRIME_TYPE
Please, regularly check the Changelog for any issues with the data.
Currently, for London data, the following issues are not yet resolved:
- City of London data for the period starting on Sep 2017 until present are not yet available due to change of IT infrastructure at the CoL police.
python3 -m crimeretriever.command builddb --dbfile new-db-name.db --rootpath ./path-to-folder-with-uk-police-csvs
The data are originally licensed by Open Government Licence v3.0. This manual, and the accompanying source code is licensed under MIT License - see LICENCE.md
Contains Ordnance Survey data © Crown copyright and database right 2012
Contains National Statistics data © Crown copyright and database right 2012