Skip to main content

UnifyPort Python SDK

English | 简体中文 | Website

Type-safe sync and async Python clients for the public UnifyPort Device API. The SDK is generated from the approved public OpenAPI contract at Node source e63d334: 80 operations, 245 component schemas, and the same retry and secret-handling classifications.

The Python package is unifyport-sdk; the import package is unifyport. The prepared source version is 0.3.0 and is not yet published. A Git tag or local build alone does not prove that a version reached PyPI.

Prepared SDK version: 0.3.0 (unreleased). See release notes and the migration guide.

Requirements

  • Python >=3.11
  • httpx >=0.27,<1
  • typing-extensions >=4.13,<5 for the Python 3.11-3.13 PEP 728 backport

Install the published package from PyPI:

python -m pip install unifyport-sdk

To work from a source checkout:

python -m pip install -e ".[dev]"

Quick start

import os

from unifyport import UnifyPortDeviceClient


def required_env(name: str) -> str:
    value = os.environ.get(name)
    if not value:
        raise RuntimeError(f"Missing required environment variable: {name}")
    return value


with UnifyPortDeviceClient(
    base_url=required_env("UNIFYPORT_DEVICE_API_BASE_URL"),
    api_key=required_env("UNIFYPORT_DEVICE_API_KEY"),
) as device:
    workspace = device.get_workspace()
    print(workspace.data)

The async client exposes the same generated snake_case operation surface:

import os

from unifyport import AsyncUnifyPortDeviceClient


async def main() -> None:
    async with AsyncUnifyPortDeviceClient(
        base_url=os.environ["UNIFYPORT_DEVICE_API_BASE_URL"],
        api_key=os.environ["UNIFYPORT_DEVICE_API_KEY"],
    ) as device:
        workspace = await device.get_workspace()
        print(workspace.data)

Generated operation methods expose path, query, and the allowlisted x_request_id header as typed keyword arguments, plus typed body= and options= when applicable. Authentication is never an operation argument:

account = device.get_account(account_id="acc_example", x_request_id="req_example")

Every call returns ApiResult[data] with only filtered metadata: data, status, and optional request_id. Raw httpx.Response objects are intentionally not public.

Safety boundaries

  • X-Api-Key comes only from client configuration and is resolved once per logical operation.
  • HTTPS is required by default. Explicitly enabled plaintext HTTP remains limited to loopback hosts.
  • Redirects are not followed, and credential-bearing requests cannot escape the configured origin or base path.
  • Automatic retry is restricted to the 19 reviewed operations and the statuses 408, 429, 502, 503, and 504, plus transport failures. Per-call settings can only tighten the global budget.
  • Requests require identity encoding; compressed responses are rejected before raw bodies are streamed through the byte limit and parsed as JSON.
  • Public errors retain stable status, error code, operation ID, and request ID only; raw response text, query strings, credentials, and underlying exception text are not exposed.
  • Cursor helpers enforce a finite page limit and reject missing or repeated cursors.
  • provider_profile and reply_token are sensitive outputs. Do not log complete account or message responses.

The package does not expose MCP tools, Agent Skills, a generic raw-request escape hatch, provider-specific orchestration, or an inferred webhook-signature algorithm.

Contract and generated code

contracts/device.openapi.yaml is the only protocol source for generation. The language-neutral policy file records semantics that cannot be inferred safely from HTTP methods. Do not edit src/unifyport/_generated/ or generated API reference pages directly.

python scripts/generate.py
python scripts/generate.py --check
python scripts/check_node_parity.py --node-repo ../UnifyPort-SDK-Nodejs --node-ref e63d3345ec530329ef368e833bc55d0c9e7385f9

See the API coverage report, architecture, security boundaries, contract maintenance guide, acceptance report, and release notes.

Validation

ruff format --check .
ruff check .
mypy --strict src scripts typing_tests
npx --yes pyright@1.1.411 pyright_tests
pytest
python -m build
twine check dist/*
python scripts/check_public.py dist/*
python scripts/smoke_installed.py
pip-audit

License

The SDK source is available under the MIT License. The Device API contract describes the service interface and retains its own license metadata.

The synchronization baseline is approved Node source e63d334, not a claim that npm has released these capabilities. No package is published by this update. See Contract update.

Facebook channel support covers session authorization, supported messages and standard callbacks.

Metadata

Release files for unifyport-sdk 0.3.0

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

Source distribution (sdist)

Source distribution for unifyport-sdk 0.3.0
File Size Uploaded Provenance Actions
unifyport_sdk-0.3.0.tar.gz 270.6 kB With provenance Details for unifyport_sdk-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unifyport-sdk 0.3.0
File Interpreter ABI Platform Actions
unifyport_sdk-0.3.0-py3-none-any.whl Python 3 none any Details for unifyport_sdk-0.3.0-py3-none-any.whl

Total release size: 359.4 kB

Release files / unifyport_sdk-0.3.0.tar.gz

Download URL unifyport_sdk-0.3.0.tar.gz
Size 270.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b664a059c3d9c055a734671aa724bfd94bdb8f83ecc52b5acb796f1faa027986
BLAKE2b-256 checksum
How to use checksums
e63bc0fd581591aff6ce1628bae8d8c865d81360986605bc98141ad9a3a82001
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 Dec 3, 2026.

Transparency log

Release files / unifyport_sdk-0.3.0-py3-none-any.whl

Download URL unifyport_sdk-0.3.0-py3-none-any.whl
Size 88.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1c00f6440d2b5b7f6cf0072d681b19ead349e11be0b33b4b47c4e60aa5c9487
BLAKE2b-256 checksum
How to use checksums
91487858dd3aeeb3e317483ec2b46a812759b1f33cd896690e4ddb4241ad6b54
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 Dec 3, 2026.

Transparency log

Security for unifyport-sdk 0.3.0

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 unifyport_sdk-0.3.0.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 Dec 3, 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.

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