Skip to main content

DEPRECATED — this package has moved to `publicsafetyapi`. Run: pip install publicsafetyapi. The `publicsafetyapi-sdk` name will no longer receive updates.

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.3.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.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: publicsafetyapi_sdk-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 68f1474941d7bcd4fd22aeca11772519498cff98c0bebb9a4ebf089cf047c5d6
MD5 28cc95d554d6617eec7f14880032a864
BLAKE2b-256 baae7ea1a7a3a384db046220c82eaef08053dac3395efd55fdc15bc5c08c5ec5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for publicsafetyapi_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43e475ee0526cdcafa63d474e8b129e437cd32c5dbacd393c951efba32e6ecde
MD5 01d34f0ec9a23c33e2085d47f812c80d
BLAKE2b-256 e84b62724ba1e8e03903701f468dcef2db41288bb8675473121b74f084779554

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