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
}

Release files for pycrime 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycrime 0.0.6
File Size Uploaded
pycrime-0.0.6.tar.gz 2.9 kB Details

Release files / pycrime-0.0.6.tar.gz

Download URL pycrime-0.0.6.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4cd474db77f040bd0790f4f1a86a0716d9e8e21700a3815ffa638bfc396bc714
BLAKE2b-256 checksum
How to use checksums
26758b41ea3b6c11bf3a089bbd1260f3c46c37f3b2e414348c463da71526e727
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.6 This release

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page