Skip to main content

Official AMEIDE Python SDK

Project description

Ameide Python SDK

ameide-sdk-python ships the unified AmeideClient with defaults and service coverage defined in sdk/README.md and sdk/manifest/ameide-client.json.

Install

  • Buf BSR (primary registry): configure Buf auth in ~/.netrc (or set PIP_NETRC=1 + NETRC=...) and install from the Buf Python index:
    cat >~/.netrc <<'NETRC'
    machine buf.build
      login user
      password ${BUF_TOKEN:?set BUF_TOKEN to a Buf API token}
    NETRC
    
    PIP_EXTRA_INDEX_URL=https://buf.build/gen/python \
      pip install ameide-sdk-python==<version>
    
  • GitHub Packages mirror:
    pip install \
      --extra-index-url https://<USER>:<PAT>@pypi.pkg.github.com/ameideio/simple/ \
      --index-url https://pypi.org/simple \
      ameide-sdk-python==<version>
    
  • GHCR (OCI) mirror for air-gapped installs:
    printf '%s' "${PAT_WITH_READ_PACKAGES}" | oras login ghcr.io --username "${GITHUB_USER}" --password-stdin
    VERSION=<version>
    oras pull ghcr.io/ameideio/ameide/ameide-sdk-python:${VERSION}
    wheel_path=$(find . -name 'ameide-sdk-python-*.whl' -print -quit)
    pip install "${wheel_path}"
    

Tokens & handling

  • PAT scope: read:packages (add write:packages only when publishing).
  • Local dev: keep the PAT in .env and feed it to pip (PIP_INDEX_URL/PIP_EXTRA_INDEX_URL) or inline in the mirror URL; never commit credentials.
  • CI: store the PAT in repo/org secrets (e.g., PKG_GITHUB_COM_TOKEN) and inject at runtime for mirror installs; PyPI publishes use PYPI_TOKEN.

Usage

from ameide_sdk.client import AmeideClient

client = AmeideClient(
    endpoint="api.ameide.io:443",
    tenant_id="...",
    user_id="...",
    auth=lambda: "...token...",
)

The client supports async/sync auth providers, tracing, retries, timeouts, tenant/user metadata, request-id injection, and transport overrides via channel or channel_factory. Optional helper factory: create_element_service(client.graph) yields convenience methods for elements/relationships without mutating the core client surface.

Integration settings

Integration tests read INTEGRATION_GRPC_ADDRESS (or NEXT_CORE_GRPC_URL), plus INTEGRATION_TENANT_ID, INTEGRATION_USER_ID, INTEGRATION_ORGANIZATION_ID, and INTEGRATION_BEARER_TOKEN; enable with RUN_INTEGRATION_TESTS=1. See sdk/README.md for the full option contract.

Testing

  • Sync and run with uv so the test extra gets installed from pyproject.toml/uv.lock:
    cd packages/ameide_sdk_python
    uv run --extra test pytest __tests__/unit __tests__/integration
    

Notes

  • Import stubs directly from ameide_core_proto.* (exposed by the SDK package).
  • The wheel bundles the generated proto/gRPC code so no additional Buf wheels or registry credentials are required beyond the registry hosting ameide-sdk-python.
  • Align release/process documentation with backlog/388-ameideio-sdks.md and keep AmeideClient behavior in sync with sdk/README.md.

Development (committed stubs, synced from BSR)

  • Sync stubs from the BSR when working from source: ./packages/ameide_sdk_python/scripts/sync_from_bsr.sh [buf.build/ameideio/ameide:ref] (requires buf access to the module).
  • CI runs the same generation step before packing/tests; the generated files are tracked in src/ameide_core_proto/** and bundled into the wheel/sdist.

Versioning

  • Source version stays 0.0.0 in Git. CI copies the package to a temp dir, stamps pyproject.toml with the tag-derived version, and runs uv build/uv publish. No committed VERSION file or env override participates in version resolution.
  • Local builds keep 0.0.0 (for ad-hoc/dev use only). The published artifacts always carry the tag-derived version.

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

ameide_sdk_python-0.1.15.dev20251127.tar.gz (161.2 kB view details)

Uploaded Source

Built Distribution

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

ameide_sdk_python-0.1.15.dev20251127-py3-none-any.whl (203.2 kB view details)

Uploaded Python 3

File details

Details for the file ameide_sdk_python-0.1.15.dev20251127.tar.gz.

File metadata

  • Download URL: ameide_sdk_python-0.1.15.dev20251127.tar.gz
  • Upload date:
  • Size: 161.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ameide_sdk_python-0.1.15.dev20251127.tar.gz
Algorithm Hash digest
SHA256 dcf8df02c5ef417df148cf1589ae0347095e861183428c5c4e52b3e2e2585578
MD5 bbfc06787a70eb80d391367b7f3fdff0
BLAKE2b-256 7c2ecc777ee4eb66e51058036834521d21f8e2a261070d294a4a0ad0c4dc4a35

See more details on using hashes here.

File details

Details for the file ameide_sdk_python-0.1.15.dev20251127-py3-none-any.whl.

File metadata

  • Download URL: ameide_sdk_python-0.1.15.dev20251127-py3-none-any.whl
  • Upload date:
  • Size: 203.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ameide_sdk_python-0.1.15.dev20251127-py3-none-any.whl
Algorithm Hash digest
SHA256 cb4c0f0d79187ed23654b97dff5673247e0ae09e582783c3c1f11a358167bd6e
MD5 8ad5e5e89204330bdd91c791a89640ff
BLAKE2b-256 30192ab73141e4395094f577899727f31270df9472f2233097b704345e7d6a48

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