Skip to main content

facet-sdk (Python)

Python SDK for the Facet Terminal — the per-merchant HTTP contract that every Facet deployment exposes.

The typed request/response surface is generated from openapi/openapi.yaml via openapi-python-client. A thin ergonomic wrapper at facet_sdk provides defaults (User-Agent, timeout) and an authenticated-client factory.

Phase 8 of openapi-as-contract. The wire surface is spec-driven — never edit src/facet_terminal_client/ by hand. Run bash scripts/regenerate.sh after scripts/build-openapi.sh to pull in the latest spec.

Install

pip install facet-sdk

Quickstart

from facet_sdk import create_terminal_client
from facet_terminal_client.api.protocol_core import get_health, get_capabilities

client = create_terminal_client("https://terminal.facet.llc")

health = get_health.sync(client=client)
# `health` is a HealthResponse, a FacetErrorEnvelope, or None

caps = get_capabilities.sync(client=client)

Authenticated calls (KYA token)

Endpoints in the four-verb commerce primitive surface (search, quote, reserve, settle) and most tool surfaces require a KYA bearer token:

from facet_sdk import create_terminal_client
from facet_terminal_client.api.protocol_core import quote
from facet_terminal_client.models import QuoteRequest

client = create_terminal_client(
    "https://terminal.facet.llc",
    kya_token="kya-bearer-from-skyfire-or-similar",
)

resp = quote.sync(client=client, body=QuoteRequest(sku="abc", quantity=1))

Architecture

Layer Module What it is
Ergonomic helpers facet_sdk Hand-written wrappers (create_terminal_client). Stable API.
Typed wire surface facet_terminal_client.api.* Auto-generated per-endpoint functions. Do not edit.
Typed schemas facet_terminal_client.models.* Auto-generated attrs classes for every components.schemas.*. Do not edit.
Generated client facet_terminal_client.Client / AuthenticatedClient Auto-generated httpx-backed dispatch class.

Regenerating from the spec

# Prerequisite: openapi-python-client on PATH
pipx install openapi-python-client==0.28.4

# Regenerate just sdk-python:
bash packages/sdk-python/scripts/regenerate.sh

# Or regenerate all three language SDKs from the spec:
bash scripts/regenerate-sdks.sh

The regen scripts are idempotent — running twice produces no diff unless openapi/openapi.yaml changed.

Tests

# Unit tests (offline):
pip install -e .[dev]
pytest

# Smoke tests against a live Facet Terminal (gated by marker):
pytest -m smoke

# Override the smoke target:
FACET_SMOKE_BASE_URL=https://my-merchant.example.com pytest -m smoke

License

Apache-2.0.

Metadata

Release files for facet-sdk 0.1.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 facet-sdk 0.1.0
File Size Uploaded Provenance Actions
facet_sdk-0.1.0.tar.gz 94.2 kB With provenance Details for facet_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for facet-sdk 0.1.0
File Interpreter ABI Platform Actions
facet_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for facet_sdk-0.1.0-py3-none-any.whl

Total release size: 441.5 kB

Release files / facet_sdk-0.1.0.tar.gz

Download URL facet_sdk-0.1.0.tar.gz
Size 94.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2feeafdad44851b3be36cf434ee5e99b829121cb9d930e7aa1a8071e875e8dd4
BLAKE2b-256 checksum
How to use checksums
43d378ff26bc5e70e70837fa786cb885467afba4f1dff830648bb31338596539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 26, 2026.

Transparency log

Release files / facet_sdk-0.1.0-py3-none-any.whl

Download URL facet_sdk-0.1.0-py3-none-any.whl
Size 347.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51dd2849462471fbdd227e490d46552b15663c87320955c34ef8d0be088f3f52
BLAKE2b-256 checksum
How to use checksums
1715f0fc9c1abcec489641336766962c34e59c9756946d81e0a4bf53ddc4492f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 26, 2026.

Transparency log

Security for facet-sdk 0.1.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 facet_sdk-0.1.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 May 26, 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

This release

0.1.0 This release

2 release files Full provenance

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