Skip to main content

PyCrime

Fetch crime statistics from the ExpenseCheck crime statistics API.

Installation

PyPi is the easiest:

pip install pycrime

Usage

Create a new API client with:

from pycrime import CrimeClient


client = CrimeClient(jwt=<your-token>)

Please replace <your-token> with your API token as a string.

Fetch crime statistics based on postcode with:

client.locality_statistics(3000)

Here, the postcode for Melbourne's CBD, 3000, has been used. Please substitute for the postcode of interest. The return value is a dict containing shaped like the following:

{
    'localityTheftRate': 27524.8484848485,  # per 100k population
    'stateTheftRate': 3448.8149871704,      # per 100k population
    'theftStateAnomaly': 698.0958267475     # percentage
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycrime-0.0.6.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file pycrime-0.0.6.tar.gz.

File metadata

  • Download URL: pycrime-0.0.6.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.8.1

File hashes

Hashes for pycrime-0.0.6.tar.gz
Algorithm Hash digest
SHA256 4cd474db77f040bd0790f4f1a86a0716d9e8e21700a3815ffa638bfc396bc714
MD5 b783f4ad395e57dc5ddb46211b539aab
BLAKE2b-256 26758b41ea3b6c11bf3a089bbd1260f3c46c37f3b2e414348c463da71526e727

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.6 This release

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

0.0.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page