{ "info": { "author": "Alex Coleman", "author_email": "a.coleman1@leeds.ac.uk", "bugtrack_url": null, "classifiers": [], "description": "[![Build Status](https://travis-ci.com/Sparrow0hawk/crime_sim_toolkit.svg?branch=refactor_poisson)](https://travis-ci.com/Sparrow0hawk/crime_sim_toolkit)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5f1ccffc3bf64553b039e31afb638045)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=Sparrow0hawk/crime_sim_toolkit&utm_campaign=Badge_Grade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/5f1ccffc3bf64553b039e31afb638045)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=Sparrow0hawk/crime_sim_toolkit&utm_campaign=Badge_Coverage)\n[![PyPI version](https://badge.fury.io/py/crime-sim-toolkit.svg)](https://badge.fury.io/py/crime-sim-toolkit)\n# Crime data simulating toolkit\n\nThis package was built over the course of an internship at Leeds Institute of Data Analytics to simulate realistic crime data (predominantly for West Yorkshire) to generate as an input into an agent-based model.\n\nThe toolkit exists in three main strategies for data simualtion:\n* a simple poisson sampler based on past data\n* a decision tree using a wide range of predictor variables\n* a microsimulation using transition probabilities\n\nThe data_manipulation folder contains notebooks highlighting how some data sources have been constructed.\n\n## Installation\n\nThis package is now available via PyPi.\n\n```{bash}\npip install crime_sim_toolkit\n```\n\nFor examples of useage checkout this example [notebook](https://github.com/Sparrow0hawk/crime_sim_toolkit/blob/master/examples/crime_sim_poisson_example.ipynb).\n## Notes on datafiles\n\nthe census_2011_population_hh.csv file is derived from [ONS data](https://www.ons.gov.uk/file?uri=/peoplepopulationandcommunity/populationandmigration/populationestimates/datasets/2011censuspopulationandhouseholdestimatesforwardsandoutputareasinenglandandwales/rft-table-php01-2011-msoas-and-lsoas.zip). Taking data from sheet LSOA and using row 12 as the header row and keeping only rows below with data.\n\n## To use\n\nThe expected input data for this package is from [Police data UK](https://data.police.uk/). If it can't find data there it will default to test data.\n\n```{python}\nimport crime_sim_toolkit.poisson_sim as Poisson_sim\n\n\nsim_week = Poisson_sim.Poisson_sim(\n # specify the local authorities to look at (all five for West Yorkshire here)\n LA_names=['Kirklees','Calderdale','Leeds','Bradford','Wakefield'],\n # specify the path to the top level directory containing PoliceUK data\n directory='/root/crime_sim_toolkit/sample_data',\n # this can either be Day or Week\n timeframe='Day',\n # do you want to aggregate data to Police Force\n aggregate=True)\n\n# view the head of the generated pandas dataframe\nsim_week.data.head()\n\ndatetime \tCrime_type \tLSOA_code \tCounts\n0 \t2017-01-01 \tAnti-social behaviour \tWest Yorkshire \t147\n1 \t2017-01-01 \tBicycle theft \tWest Yorkshire \t7\n2 \t2017-01-01 \tBurglary \tWest Yorkshire \t65\n```\n\nThis will create an object that contains the PoliceUK data formated into counts by crime type, by LSOA (or Police force) by timeframe. Forecasts can be generated using this transformed past data as shown in the [example notebooks](https://github.com/Sparrow0hawk/crime_sim_toolkit/tree/master/examples).\n\n## TODO\n\n* Build method for using Police data API\n* microsimulation\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Sparrow0hawk/crime_sim_toolkit", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "crime-sim-toolkit", "package_url": "https://pypi.org/project/crime-sim-toolkit/", "platform": "", "project_url": "https://pypi.org/project/crime-sim-toolkit/", "project_urls": { "Homepage": "https://github.com/Sparrow0hawk/crime_sim_toolkit" }, "release_url": "https://pypi.org/project/crime-sim-toolkit/1.4.1/", "requires_dist": null, "requires_python": ">=3.5", "summary": "A toolkit for simulating UK crime data.", "version": "1.4.1" }, "last_serial": 5964774, "releases": { "1.3.0": [ { "comment_text": "", "digests": { "md5": "429be0fc0b40b7a7149c57a4f07672f6", "sha256": "7540c1861f90478ddb50c439a9dac42b0d3a1fba3df8b2d774f666a835e3e9e9" }, "downloads": -1, "filename": "crime_sim_toolkit-1.3.0.tar.gz", "has_sig": false, "md5_digest": "429be0fc0b40b7a7149c57a4f07672f6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7229990, "upload_time": "2019-09-09T13:13:02", "url": "https://files.pythonhosted.org/packages/38/78/bce2e0a1c897f0e43cf3b7907ba951d8745c6c56fa73565183a1435d9e61/crime_sim_toolkit-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "bf009eb6e031923d7fc0c1a3256f2507", "sha256": "bea01001f3ddbeb88ca2129f951c029ac65392e18a81c0d77a718c3aff2f59f6" }, "downloads": -1, "filename": "crime_sim_toolkit-1.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bf009eb6e031923d7fc0c1a3256f2507", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6539834, "upload_time": "2019-10-02T13:31:15", "url": "https://files.pythonhosted.org/packages/fa/83/f349efb561d5691f2cea7134df23c3f416454db5f4404a4061f9bf0cee16/crime_sim_toolkit-1.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c409241edc03a3d98cc1eac1a6fd6c90", "sha256": "df33dcbb03745680439689a20940dcc16f5a4872dbbca2dddcef0c7806263056" }, "downloads": -1, "filename": "crime_sim_toolkit-1.4.0.tar.gz", "has_sig": false, "md5_digest": "c409241edc03a3d98cc1eac1a6fd6c90", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6370163, "upload_time": "2019-10-02T13:31:19", "url": "https://files.pythonhosted.org/packages/c8/ce/74dc70c791a04fc8428d89e18e01f316aee851844c50d3c5c6e178e4e341/crime_sim_toolkit-1.4.0.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "06efcf7d3a4cad3057e4bc2bbd09c061", "sha256": "4da06cf49b037228c3ecfe8aac642a2ebaaaf511d4b248d7f1899bbf24acc64e" }, "downloads": -1, "filename": "crime_sim_toolkit-1.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "06efcf7d3a4cad3057e4bc2bbd09c061", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6539863, "upload_time": "2019-10-12T16:22:08", "url": "https://files.pythonhosted.org/packages/e6/fa/9e2466cbfa706aa5522fcaf54ee59086d1277a3aefe22201f480b83d54c2/crime_sim_toolkit-1.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4b360fdbab1fd87c1ecf8d4936cea42e", "sha256": "19f354293dd12aa2cedbbc440c8dff6a75b94e816b5337acc9e39dbbeef3768a" }, "downloads": -1, "filename": "crime_sim_toolkit-1.4.1.tar.gz", "has_sig": false, "md5_digest": "4b360fdbab1fd87c1ecf8d4936cea42e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6370176, "upload_time": "2019-10-12T16:23:26", "url": "https://files.pythonhosted.org/packages/51/0e/70861f04c18ee75c57fc4b8b4ca6a4947f32a56be7a89e32e65683317cdc/crime_sim_toolkit-1.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "06efcf7d3a4cad3057e4bc2bbd09c061", "sha256": "4da06cf49b037228c3ecfe8aac642a2ebaaaf511d4b248d7f1899bbf24acc64e" }, "downloads": -1, "filename": "crime_sim_toolkit-1.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "06efcf7d3a4cad3057e4bc2bbd09c061", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6539863, "upload_time": "2019-10-12T16:22:08", "url": "https://files.pythonhosted.org/packages/e6/fa/9e2466cbfa706aa5522fcaf54ee59086d1277a3aefe22201f480b83d54c2/crime_sim_toolkit-1.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4b360fdbab1fd87c1ecf8d4936cea42e", "sha256": "19f354293dd12aa2cedbbc440c8dff6a75b94e816b5337acc9e39dbbeef3768a" }, "downloads": -1, "filename": "crime_sim_toolkit-1.4.1.tar.gz", "has_sig": false, "md5_digest": "4b360fdbab1fd87c1ecf8d4936cea42e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6370176, "upload_time": "2019-10-12T16:23:26", "url": "https://files.pythonhosted.org/packages/51/0e/70861f04c18ee75c57fc4b8b4ca6a4947f32a56be7a89e32e65683317cdc/crime_sim_toolkit-1.4.1.tar.gz" } ] }