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.*; legacy ameide_sdk.generated.* paths have been removed.
  • 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 (no committed generated code)

  • Generate stubs locally when working from source: ./packages/ameide_sdk_python/scripts/gen_protos.sh (requires buf and the core proto workspace present).
  • CI runs the same generation step before packing/tests; the generated files stay git-ignored but are included in 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.dev20251125.tar.gz (144.0 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.dev20251125-py3-none-any.whl (188.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ameide_sdk_python-0.1.15.dev20251125.tar.gz
  • Upload date:
  • Size: 144.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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.dev20251125.tar.gz
Algorithm Hash digest
SHA256 60925c3d3171696ba538f93549ee53699feaa2cd514afa6ca5311f1d11b71d21
MD5 7b28a453e7445ba739c6128b529bcb42
BLAKE2b-256 7ff1d845abc8d0b790028241cc3993a552f4aad95d16c5da07d869106d7d736b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ameide_sdk_python-0.1.15.dev20251125-py3-none-any.whl
  • Upload date:
  • Size: 188.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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.dev20251125-py3-none-any.whl
Algorithm Hash digest
SHA256 e98c4479c2554a7f623d3ae96a03a091fc652f97759fb5b83a6ab32de8bd112f
MD5 65394e553b34a5c523e6265380385c78
BLAKE2b-256 d70621f6b1a268df3aed2eb9fe39c505cd1ef32b0ae81fbfff19b085e9f3525a

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