Skip to main content

ADP Python SDK

Python SDK for the Agentic Data Protocol (ADP) — a deterministic, policy-aware protocol that allows AI agents to access heterogeneous data systems safely and reproducibly via a unified intent interface.

This SDK provides a client-side API for connecting to any ADP-compliant server (such as adp-hypervisor) over stdio transport.

Installation

# Using uv (recommended)
uv add adp-sdk

# Using pip
pip install adp-sdk

Quick Start

import asyncio
from adp_sdk import stdio_client, basic_auth, QueryIntent, PredicateGroup

async def main():
    async with stdio_client(
        "python", ["-m", "adp_hypervisor", "--config", "config.yaml"],
        authorization=basic_auth("alice", "secret"),
    ) as session:
        # 1. Discover available resources
        discovery = await session.discover()
        for resource in discovery.resources:
            print(f"  {resource.resource_id}: {resource.description}")

        # 2. Describe a resource to get its usage contract
        contract = await session.describe("com.example:users", "QUERY")
        print(f"Fields: {[f.field_id for f in contract.usage_contract.fields]}")

        # 3. Execute an intent
        intent = QueryIntent(
            intentClass="QUERY",
            resourceId="com.example:users",
            predicates=PredicateGroup(op="AND", predicates=[]),
        )
        result = await session.execute(intent)
        print(f"Got {len(result.results)} rows")

asyncio.run(main())

API Overview

stdio_client (convenience)

async with stdio_client(command, authorization=basic_auth("user", "secret")) as session:
    ...

Launches an ADP server as a subprocess and returns an initialized ClientSession.

ClientSession

Method Description
discover(filter?, cursor?) List available resources
describe(resource_id, intent_class, version?, cursor?) Get a resource's usage contract
validate(intent) Check if an intent is valid
execute(intent, cursor?) Run an intent against a resource
ping() Check server liveness

Error Handling

All server errors are mapped to typed exceptions:

from adp_sdk import ResourceNotFoundError, ValidationFailedError

try:
    result = await session.execute(intent)
except ResourceNotFoundError as e:
    print(f"Resource not found: {e}")
except ValidationFailedError as e:
    print(f"Invalid intent: {e}")

Development

# Install dependencies
uv sync --all-extras

# Run tests
uv run python -m unittest discover -s tests -v

# Type checking
uv run pyright

# Linting
uv run ruff check .

License

Apache-2.0

Metadata

Release files for adp-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 adp-sdk 0.1.0
File Size Uploaded Provenance
adp_sdk-0.1.0.tar.gz 73.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 104.9 kB

Release files / adp_sdk-0.1.0.tar.gz

Download URL adp_sdk-0.1.0.tar.gz
Size 73.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2bfa89d76c0017ab513e8120ae96dbc2cbaf535fdeee1998eb89dd98ddcb4f2a
BLAKE2b-256 checksum
How to use checksums
958b6dac33fba8f33115a2594ca609a54ada3b3e854f22ccfe14b555a879a2ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"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}

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

Download URL adp_sdk-0.1.0-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81fb5a3d7037b318d75f56b15ab319e8d3c4c419543e797b651420166945cb6b
BLAKE2b-256 checksum
How to use checksums
fbfd15dde4952f3f4c358976b6409b9e4e1a3243164750a2b2036c2c96c143f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"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}

Security for adp-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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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