Skip to main content

Sonoran.py

Sonoran.py is the Python library for Sonoran CAD and Radio integrations.

This repository currently focuses on the CAD and Radio v2 API surfaces and mirrors the public helper names from Sonoran.js.

Install

pip install Sonoran.py

Example Usage

from sonoran import Instance, productEnums

instance = Instance(
    apiKey="YOUR_API_KEY",
    communityId="YOUR_COMMUNITY_ID",
    product=productEnums.CAD,
    serverId=1,
)

response = instance.cad.createEmergencyCallV2(
    {
        "serverId": 1,
        "isEmergency": True,
        "caller": "John Doe",
        "location": "101 Alta Street",
        "description": "Structure fire with visible smoke.",
        "deleteAfterMinutes": 30,
    }
)

if response.success:
    print(response.data)
else:
    print(response.reason)
penal_codes = instance.cad.getPenalCodesV2()
if penal_codes.success:
    print(penal_codes.data)
link_response = instance.cad.setCommunityLinkV2(
    {
        "accountUuid": "USER_ACCOUNT_UUID",
        "secretUuid": "USER_ACCOUNT_SECRET_UUID",
        "communityUserId": "fivem:12345",
    }
)
location_response = instance.cad.updateUnitLocationsV2(
    {
        "serverId": 1,
        "updates": [
            {
                "roblox": 123456789,
                "location": "Mission Row",
            }
        ],
    }
)
with open("bodycam-clip.webm", "rb") as clip:
    bodycam_response = instance.cad.uploadBodycamRecordingV2(
        {
            "accountUuid": "USER_ACCOUNT_UUID",
            "durationMs": 90000,
            "identId": 123,
            "unitNumber": "1A-12",
            "unitLocation": "Senora Fwy / Route 68",
            "fileName": "bodycam-clip.webm",
            "fileContent": clip.read(),
            "contentType": "video/webm",
        }
    )

Notes

  • CAD and Radio v2 helpers are included right now.
  • Helper names match Sonoran.js.
  • Radio v2 clients use communityId for /v2/servers/{communityId} routes and roomId on client creation for room-scoped helpers:
radio = Instance(
    apiKey="YOUR_RADIO_API_KEY",
    communityId="YOUR_COMMUNITY_ID",
    product=productEnums.RADIO,
    roomId=2,
)

radio.setRoomId(1)
  • instance.cad.setStationsV2(...) sends locations, tones, and unitColors at the top level of the request body.
  • Bodycam uploads use instance.cad.uploadBodycamRecordingV2(...) with multipart form data built by the SDK.
  • CAD v2 requests automatically retry 429 responses up to 2 times and respect Retry-After when it is provided.
  • Account-targeted CAD v2 helpers accept accountUuid, communityUserId, roblox, discord, and legacy apiId where supported by the backend.
  • The import package remains sonoran.

Metadata

Release files for Sonoran.py 0.1.21

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

Source distribution (sdist)

Source distribution for Sonoran.py 0.1.21
File Size Uploaded Provenance Actions
sonoran_py-0.1.21.tar.gz 14.4 kB With provenance Details for sonoran_py-0.1.21.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Sonoran.py 0.1.21
File Interpreter ABI Platform Actions
sonoran_py-0.1.21-py3-none-any.whl Python 3 none any Details for sonoran_py-0.1.21-py3-none-any.whl

Total release size: 28.1 kB

Release files / sonoran_py-0.1.21.tar.gz

Download URL sonoran_py-0.1.21.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c9e61f05f246d8214d7949abca62a2cc451edd22c09cfac5f4a6a96218e5ff6f
BLAKE2b-256 checksum
How to use checksums
aa8774b2d71744728c3f834979aaff7ce49521ee7c393491d0f631b57dd37419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / sonoran_py-0.1.21-py3-none-any.whl

Download URL sonoran_py-0.1.21-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7896aea5ee60298d0cd042df4f7da85fb89ed7d5f653e1efcd78ba822ebc392
BLAKE2b-256 checksum
How to use checksums
a9989daf4830dd83a6ffa593aeb7bfc0a01fc18d6290b333d4b17a2e1cc5ec63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Security for Sonoran.py 0.1.21

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sonoran_py-0.1.21.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

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