Skip to main content

ACCX Python SDK

Install with pip install accx after publishing this package.

from accx import AccxClient, JobSubmission

client = AccxClient(base_url=os.environ["ACCX_BASE_URL"], workload_token=os.environ["ACCX_WORKLOAD_TOKEN"])
result = client.submit_action(JobSubmission(
    action="provider.publish",
    secret_references=[os.environ["SOCIAL_TWITTER_REF"]],
    required_scopes=["job.execute", "provider.publish"],
    input={"contentId": "post-123"},
    idempotency_key=str(uuid.uuid4()),
))

Only stable references and sanitized job results cross the SDK boundary.

Metadata, async, and error handling

get_secret_metadata(reference) returns rotation and health metadata only. It never returns a credential value. AsyncAccxClient provides the same reference-only methods for async services, and AccxError exposes a safe status code plus a retryable flag for transient failures.

from accx import AsyncAccxClient, redact

client = AsyncAccxClient(
    base_url=os.environ["ACCX_BASE_URL"],
    workload_token=os.environ["ACCX_WORKLOAD_TOKEN"],
)
metadata = await client.get_secret_metadata(os.environ["SOCIAL_TWITTER_REF"])
safe_context = redact({"reference": metadata.reference, "token": "never log this"})

For a FastAPI service, fastapi_client_dependency() returns a dependency callable without importing FastAPI or adding a browser-facing integration. It constructs the client only from server process variables ACCX_BASE_URL and ACCX_WORKLOAD_TOKEN.

Environment variables with EnvLoader

Store the ACCX reference in your .env value and expand it at boot with a personal access token:

GEMINI_KEY=accx://acme/production:GEMINI_KEY
DB_HOST=accx://acme/production:DB_HOST
LOCAL_DEV_FLAG=off
from accx import EnvLoader

loader = EnvLoader(
    base_url=os.environ["ACCX_BASE_URL"],
    personal_token=os.environ["ACCX_PERSONAL_TOKEN"],  # accx_pat_...
)
env = loader.load(
    local=os.environ,             # explicit local values win
    accx=Path(".env").read_text(),
)

accx://<project>/<environment>:<KEY> is resolved server-side only for the token's own workspace; development, staging, and production are the only environments. Resolution is batched per environment, and keys missing on the server raise AccxError with status 404.

Metadata

Release files for accx 0.2.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 accx 0.2.0
File Size Uploaded
accx-0.2.0.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for accx 0.2.0
File Interpreter ABI Platform
accx-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.7 kB

Release files / accx-0.2.0.tar.gz

Download URL accx-0.2.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9f9397747629bcf3507196b26d1590d3a2f05539b1136c54d177787471d05a61
BLAKE2b-256 checksum
How to use checksums
2bb939bc4338d46eafbafe5eb02b923fc8d4c2163687fb84f28674b753d6f96d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / accx-0.2.0-py3-none-any.whl

Download URL accx-0.2.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10ecdde18293f14fffca7d6171f8fd89efce3017dd49106c57dcda025c0d8784
BLAKE2b-256 checksum
How to use checksums
bc1541248639fd0f8d6e922be6790109765d2ccc28d4e241923813ec01498516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.1

1 release file

0.1.0

1 release file

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