Skip to main content

Python SDK for publicsafetyapi.dev — US police stations, fire stations, hospitals, and EMS locations. Install: pip install publicsafetyapi-sdk · Import: from publicsafetyapi import PublicSafetyAPI

Project description

publicsafetyapi-sdk

Python SDK for publicsafetyapi.dev — the developer API for US public safety facility data.

Every police station, fire station, hospital, and EMS location in the United States — sourced from HIFLD (DHS/CISA) and CMS federal datasets — in a single clean REST API.


Installation

pip install publicsafetyapi-sdk

Quick Start

from publicsafetyapi import PublicSafetyAPI

client = PublicSafetyAPI(api_key="psk_live_...")

# Find the 5 nearest fire stations to any US address
stations = client.stations.nearby(
    address="12865 Main St, Apple Valley, CA",
    type="fire",
    radius_miles=10
)
for s in stations:
    print(f"{s.name}{s.distance_miles:.1f} mi")

# Which police department has jurisdiction over an address?
result = client.jurisdiction(
    address="12865 Main St, Apple Valley, CA",
    type="police"
)
print(result.likely_agencies[0].name)  # "Apple Valley Police Department"

# Look up any facility by ID
hospital = client.stations.get("hospital-hifld-112233")
print(hospital.trauma_level)    # "Level II"
print(hospital.beds)            # 212
print(hospital.cms_ccn)         # "050317"

What's Covered

Entity Type Source Records
Police stations HIFLD (DHS/CISA) 68,000+
Fire stations HIFLD (DHS/CISA) 55,000+
EMS stations HIFLD (DHS/CISA) 10,000+
Hospitals HIFLD + CMS 7,500+

API Key

Get a free API key (500 calls/month) at publicsafetyapi.dev.

Full SDK

The full SDK implementation ships with v0.2.0 alongside the API launch.
Sign up at publicsafetyapi.dev for early access.

Related

License

MIT

Project details


Download files

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

Source Distribution

publicsafetyapi_sdk-0.2.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

publicsafetyapi_sdk-0.2.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file publicsafetyapi_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: publicsafetyapi_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for publicsafetyapi_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3b95a7f8cf2681fd66ec72112a69f549e0940bc227a9b2397a4928dba5c24bd9
MD5 cccc5684be4ce178f66b2367bae47d26
BLAKE2b-256 22ec7cce62204547fd8f9b5672dcb6ac82d39852d723290f1eb0ba00ec80af3c

See more details on using hashes here.

File details

Details for the file publicsafetyapi_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for publicsafetyapi_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52b924da7a98abab50b5e73112ae5c55585d96982906017e9f2f096f262089f6
MD5 50bf5bc704e0df600908bf7128ddf706
BLAKE2b-256 f1bdba3c5bbd0b76aa310da65c198d454f4e4b6bfb4bd35755a7b26094428d67

See more details on using hashes here.

Supported by

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