Skip to main content

Python SDK for the ArchAstro Platform API

Project description

archastro-python

Python SDK for the ArchAstro Platform API.

uv add archastro-sdk      # or: pip install archastro-sdk
from archastro import ArchAstro

client = ArchAstro(api_key="pk_...")
teams = client.v1.teams.list()

Packages

All public code lives under the single top-level archastro package:

  • archastro.platform — typed REST + channel SDK generated from the canonical OpenAPI spec at ArchAstro/archastro-openapi. Pydantic models, async channel classes, auth helpers.
  • archastro.phx_channel — the hand-written Phoenix Channels client the generated channel classes run on top of. WebSocket transport, join / reply / push / leave, heartbeat, reconnect, and a HarnessServiceClient for driving the @archastro/channel-harness service from Python tests.

Development

This repo contains:

  • Python SDK (src/archastro/) installed via uv
  • JS tooling (package.json) — the channel-harness subprocess that powers the channel contract tests, plus the Prism mock server that backs the REST contract tests. Installed via npm ci.

Setup

npm ci --ignore-scripts  # channel-harness + prism (for contract tests)
uv sync --locked --all-extras

Running tests

# Unit tests only (no external services needed)
uv run pytest tests/test_http_client.py src/archastro/phx_channel/tests/test_unit.py

# REST contract tests (spawns Prism mock server)
uv run pytest tests/contract

# REST + channel contract tests (also spawns channel-harness subprocess)
ARCHASTRO_RUN_CHANNEL_CONTRACT_TESTS=1 uv run pytest tests/contract

Regenerating the SDK

The typed SDK — src/archastro/platform/ and tests/contract/ — is regenerated from the canonical OpenAPI spec by @archastro/sdk-generator. Don't hand-edit files with the auto-generated by @archastro/sdk-generator header; they'll be overwritten.

./scripts/regenerate_sdk.sh

The script fetches the spec from ArchAstro/archastro-openapi@main and runs the generator locked in package-lock.json. Knobs:

  • ARCHASTRO_OPENAPI_REF=some-branch ./scripts/regenerate_sdk.sh — pull the spec from a non-default ref (useful when a spec change is on a branch awaiting merge).

After regenerating, review the diff, run the full test suite, and commit.

Release

# bump version in pyproject.toml, then:
uv sync --locked --all-extras
uv build --no-build-isolation
uv publish

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

archastro_sdk-0.1.1.tar.gz (225.1 kB view details)

Uploaded Source

Built Distribution

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

archastro_sdk-0.1.1-py3-none-any.whl (96.6 kB view details)

Uploaded Python 3

File details

Details for the file archastro_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: archastro_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 225.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for archastro_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 648665e3f1588fac98b773aeca78e4011e12ed877ae213c48aa074fe55dc6f7e
MD5 5af1875260f583fae3136e1d1eedae89
BLAKE2b-256 60ba7a8ff1eddc07b52a9e1541fb8388feaac01b0a3ca614ead422d140c46b48

See more details on using hashes here.

Provenance

The following attestation bundles were made for archastro_sdk-0.1.1.tar.gz:

Publisher: publish.yml on ArchAstro/archastro-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file archastro_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: archastro_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 96.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for archastro_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f306e06676a16e3f3410166b3e68803768e620b73d59000931acd59f77b89f8
MD5 a01b0643cbb85c24d444886523b1bd8f
BLAKE2b-256 068f8c04d74ae872d545ac622441b8d1ef3812f9e1004d48798834577d7a160e

See more details on using hashes here.

Provenance

The following attestation bundles were made for archastro_sdk-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ArchAstro/archastro-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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