Core client SDK for the Copass platform (Python mirror of @copass/core)
Project description
copass-core
Core client SDK for the Copass platform. Python mirror of @copass/core — shared foundation for every Python Copass adapter.
Install
pip install copass-core
Requires httpx>=0.27. Python ≥ 3.10.
Quickstart
import asyncio
from copass_core import CopassClient, ApiKeyAuth
async def main():
client = CopassClient(auth=ApiKeyAuth(key="olk_..."))
# Retrieval
menu = await client.retrieval.discover(
sandbox_id="sb_...",
query="How does auth work?",
)
print(menu["items"])
# Context for agent
context = await client.context.for_agent(
sandbox_id="sb_...",
tier="adaptive",
query="auth flow",
)
print(context)
asyncio.run(main())
Auth options
from copass_core import CopassClient, ApiKeyAuth, BearerAuth, ProviderAuth
# Long-lived API key (olk_ prefix)
CopassClient(auth=ApiKeyAuth(key="olk_..."))
# Raw Bearer JWT (caller owns refresh)
CopassClient(auth=BearerAuth(token="eyJ..."))
# Custom AuthProvider implementation
class MyProvider:
async def get_session(self):
from copass_core import SessionContext
return SessionContext(access_token=await _mint_token())
CopassClient(auth=ProviderAuth(provider=MyProvider()))
Available resources
Full resource surface matching @copass/core:
client = CopassClient(auth=ApiKeyAuth(key="olk_..."))
# Narrow retrieval tools
await client.retrieval.discover(sandbox_id, query="...")
await client.retrieval.interpret(sandbox_id, query="...", items=[...])
await client.retrieval.search(sandbox_id, query="...")
await client.context.for_agent(sandbox_id="...", tier="adaptive")
# Storage layer
await client.sandboxes.create(name="...", owner_id="...")
await client.sources.register(sandbox_id, provider="custom", name="...")
await client.ingest.text_in_sandbox(sandbox_id, text="...")
await client.projects.create(sandbox_id, name="...")
await client.vault.store(sandbox_id, "key/path", b"bytes")
# Knowledge graph
await client.entities.search(sandbox_id, q="auth")
await client.matrix.query(query="...")
# Account
await client.users.get_profile()
await client.api_keys.create(name="ci")
await client.usage.get_balance()
# Higher-order — ephemeral data source wrapping agent conversation
window = await client.context_window.create(sandbox_id=sandbox_id)
await window.add_turn(ChatMessage(role="user", content="..."))
# Pass directly to retrieval for window-aware calls:
await client.retrieval.search(sandbox_id, query="...", window=window)
v0.2 scope
Shipped in v0.2:
- Full resource surface (12 resource classes, all public paths).
ContextWindow+ContextWindowResource.BaseDataSource+ensure_data_sourcefor custom driver subclasses.HttpClientraw-body / raw-response support (enables vault blob I/O).
Deferred to v0.3:
- Crypto primitives (HKDF, AES-GCM, session tokens, DEK).
- Supabase OTP auth provider (requires crypto).
BearerAuth(encryption_key=...)currently stores the key but doesn't derive a session token — works when the server doesn't demand one.
Open a PR with a scoped addition if you need those sooner.
License
MIT.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file copass_core-0.4.2.tar.gz.
File metadata
- Download URL: copass_core-0.4.2.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6b3c1b7d525afede97e14715653bd78fb1505990974932c138009bede82ba58
|
|
| MD5 |
597e9783225b04340a26de698834ca05
|
|
| BLAKE2b-256 |
13ad48cff7d5d5f34402bd2c476a4b26de6844555832ddf557d84a0d014ac53e
|
Provenance
The following attestation bundles were made for copass_core-0.4.2.tar.gz:
Publisher:
release-python.yml on olane-labs/copass-harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
copass_core-0.4.2.tar.gz -
Subject digest:
d6b3c1b7d525afede97e14715653bd78fb1505990974932c138009bede82ba58 - Sigstore transparency entry: 1398169417
- Sigstore integration time:
-
Permalink:
olane-labs/copass-harness@400164c49940148117093da38275c6a8e302b8ad -
Branch / Tag:
refs/heads/production - Owner: https://github.com/olane-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@400164c49940148117093da38275c6a8e302b8ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file copass_core-0.4.2-py3-none-any.whl.
File metadata
- Download URL: copass_core-0.4.2-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef928aa601fc8afbe5e902ed49656e65f85deb45b7d2664c002596ae6fdaefb
|
|
| MD5 |
fb97b072a6bacc7096e7ea73642698f6
|
|
| BLAKE2b-256 |
9a5b888c55be54db9490ceceb2b38b072e4d7dd28d6cfb0e99a53ec86539568f
|
Provenance
The following attestation bundles were made for copass_core-0.4.2-py3-none-any.whl:
Publisher:
release-python.yml on olane-labs/copass-harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
copass_core-0.4.2-py3-none-any.whl -
Subject digest:
bef928aa601fc8afbe5e902ed49656e65f85deb45b7d2664c002596ae6fdaefb - Sigstore transparency entry: 1398169442
- Sigstore integration time:
-
Permalink:
olane-labs/copass-harness@400164c49940148117093da38275c6a8e302b8ad -
Branch / Tag:
refs/heads/production - Owner: https://github.com/olane-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@400164c49940148117093da38275c6a8e302b8ad -
Trigger Event:
push
-
Statement type: