Atlas SDK for Python - Client library for Atlas Control Plane
Project description
Atlas SDK for Python
The official Python client library for the Atlas Control Plane API. This SDK enables AI agents to self-report their existence, configuration, and health to the Atlas Control Plane.
Installation
pip install ryora-atlas-sdk
Quickstart
Synchronous Client
from atlas_sdk import ControlPlaneClient, AgentConfiguration
# Create client (reads ATLAS_API_URL and ATLAS_API_KEY from environment)
client = ControlPlaneClient()
# Register your agent
client.register(
name="my-agent",
owner="team@company.com",
configuration=AgentConfiguration(
model_provider="anthropic",
model_name="claude-sonnet-4-20250514",
tools=["file_read", "file_write"],
),
)
# Heartbeats are sent automatically in the background
# Do your agent work here...
# Deregister when done
client.deregister()
Using Context Manager
The recommended way to use the client is with a context manager, which ensures proper cleanup:
from atlas_sdk import ControlPlaneClient, AgentConfiguration
with ControlPlaneClient() as client:
client.register(
name="my-agent",
owner="team@company.com",
configuration=AgentConfiguration(
model_provider="anthropic",
model_name="claude-sonnet-4-20250514",
tools=["file_read"],
),
)
# Do work...
# Automatic deregistration on exit
Asynchronous Client
import asyncio
from atlas_sdk import AsyncControlPlaneClient, AgentConfiguration
async def main():
async with AsyncControlPlaneClient() as client:
await client.register(
name="my-async-agent",
owner="team@company.com",
configuration=AgentConfiguration(
model_provider="anthropic",
model_name="claude-sonnet-4-20250514",
tools=["web_search"],
),
)
# Do async work...
asyncio.run(main())
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
ATLAS_API_URL |
Control Plane API base URL | (required) |
ATLAS_API_KEY |
API key for authentication | (required) |
ATLAS_ENVIRONMENT |
Deployment environment (local, staging, production) | Auto-detected |
ATLAS_DISABLED |
Disable SDK entirely (true/1/yes) | false |
ATLAS_SKIP_CONTEXT_DETECTION |
Skip context auto-detection (true/1/yes) | false |
Client Options
client = ControlPlaneClient(
base_url="https://api.atlas.example.com", # Override ATLAS_API_URL
api_key="your-api-key", # Override ATLAS_API_KEY
timeout=30.0, # Request timeout in seconds
fail_silently=True, # Log errors instead of raising (default: True)
auto_detect_context=True, # Auto-detect deployment context (default: True)
auto_heartbeat=True, # Enable background heartbeats (default: True)
heartbeat_interval_seconds=300, # Heartbeat interval (default: 5 minutes)
max_retries=3, # Max retry attempts for transient errors
)
Deployment Context
The SDK automatically detects deployment context including:
- hostname: Via
socket.gethostname() - environment: Via
ATLAS_ENVIRONMENTenv var or hostname inference - has_internet_access: Via connectivity check
- has_filesystem_access: Via container/sandbox detection
You can also provide explicit context:
from atlas_sdk import ControlPlaneClient, AgentConfiguration, DeploymentContext, ResourceLimits
client.register(
name="my-agent",
owner="team@company.com",
configuration=AgentConfiguration(
model_provider="anthropic",
model_name="claude-sonnet-4-20250514",
tools=["file_read"],
),
deployment_context=DeploymentContext(
hostname="prod-server-01",
environment="production",
has_internet_access=True,
has_filesystem_access=False,
resource_limits=ResourceLimits(
max_memory_mb=4096,
max_cpu_cores=2,
),
),
)
Manual Heartbeats
While heartbeats are sent automatically, you can send manual heartbeats with custom status and metrics:
from atlas_sdk import HeartbeatStatus
# Send a heartbeat with custom status
client.heartbeat(
status=HeartbeatStatus.DEGRADED,
metrics={
"requests_processed": 1500,
"error_rate": 0.02,
"memory_usage_mb": 512,
},
)
Updating Configuration
Update your agent's configuration after registration:
from atlas_sdk import AgentConfiguration
client.update_configuration(
configuration=AgentConfiguration(
model_provider="anthropic",
model_name="claude-opus-4-20250514", # Upgraded model
tools=["file_read", "file_write", "shell"],
),
)
Error Handling
The SDK provides a comprehensive exception hierarchy:
from atlas_sdk import (
AtlasError, # Base exception for all SDK errors
AtlasConnectionError, # Network/connection errors (retryable)
AuthenticationError, # 401 - Invalid API key
AuthorizationError, # 403 - Insufficient permissions
AtlasValidationError, # 422 - Invalid request data
RateLimitError, # 429 - Rate limited (retryable)
AgentNotFoundError, # 404 - Agent not registered
DuplicateAgentError, # 409 - Agent ID conflict
)
try:
client.register(...)
except AuthenticationError:
print("Invalid API key")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after} seconds")
except AtlasError as e:
print(f"Atlas error: {e}")
Fail-Safe Mode
By default, the SDK operates in fail-safe mode (fail_silently=True), which means:
- Errors are logged but don't crash your agent
- Methods return
Noneon failure - Your agent continues operating even if the Control Plane is unreachable
To receive exceptions instead:
client = ControlPlaneClient(fail_silently=False)
Retry Behavior
The SDK automatically retries transient errors with exponential backoff:
- Connection errors
- Rate limit errors (429)
- Server errors (5xx)
Non-retryable errors (4xx except 429) fail immediately.
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=atlas_sdk --cov-report=term-missing
# Type checking
mypy src/
# Linting
ruff check src/ tests/
ruff format src/ tests/
License
Proprietary - Atlas Team
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 ryora_atlas_sdk-1.3.0.tar.gz.
File metadata
- Download URL: ryora_atlas_sdk-1.3.0.tar.gz
- Upload date:
- Size: 54.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b421742669bddfd7c4324c5829edb86acca11d5b62d3701fa145fd419df83228
|
|
| MD5 |
d881628c1218d34a88820c92b632246d
|
|
| BLAKE2b-256 |
980e674562087cc355928b8777cbd42edb700888e991e5a58769521d3cea8e57
|
Provenance
The following attestation bundles were made for ryora_atlas_sdk-1.3.0.tar.gz:
Publisher:
python-sdk-release.yml on ryora-ai/atlas-monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ryora_atlas_sdk-1.3.0.tar.gz -
Subject digest:
b421742669bddfd7c4324c5829edb86acca11d5b62d3701fa145fd419df83228 - Sigstore transparency entry: 907225307
- Sigstore integration time:
-
Permalink:
ryora-ai/atlas-monorepo@eb77e566409706420ad09a119f01ec27018d9eaf -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ryora-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdk-release.yml@eb77e566409706420ad09a119f01ec27018d9eaf -
Trigger Event:
push
-
Statement type:
File details
Details for the file ryora_atlas_sdk-1.3.0-py3-none-any.whl.
File metadata
- Download URL: ryora_atlas_sdk-1.3.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c4a093117742787025c42c5f3a48432a2a99738e8e80906b324f0f03da528b6
|
|
| MD5 |
5d38048c6cf29383b9f186ab543eec8b
|
|
| BLAKE2b-256 |
e84d4478e157327d3bc2127842ba82329132d54327c8be6e8eaa2b2ab6f021fe
|
Provenance
The following attestation bundles were made for ryora_atlas_sdk-1.3.0-py3-none-any.whl:
Publisher:
python-sdk-release.yml on ryora-ai/atlas-monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ryora_atlas_sdk-1.3.0-py3-none-any.whl -
Subject digest:
5c4a093117742787025c42c5f3a48432a2a99738e8e80906b324f0f03da528b6 - Sigstore transparency entry: 907225319
- Sigstore integration time:
-
Permalink:
ryora-ai/atlas-monorepo@eb77e566409706420ad09a119f01ec27018d9eaf -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ryora-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdk-release.yml@eb77e566409706420ad09a119f01ec27018d9eaf -
Trigger Event:
push
-
Statement type: