Python SDK for the Arga API
Project description
Arga Python SDK
Typed Python client for the Arga API. Supports both synchronous and asynchronous usage.
Installation
pip install arga-sdk
Quick Start
from arga_sdk import Arga
client = Arga(api_key="arga_...")
# Create a URL run with service twins
run = client.runs.create_url_run(
url="https://staging.myapp.com",
twins=["stripe", "slack"],
)
print(run.run_id, run.status)
# Poll until the run completes
detail = client.runs.wait(run.run_id, timeout=300)
print(detail.status, detail.results_json)
# Stream live results
for event in client.runs.stream_results(run.run_id):
print(event)
# Cancel a run
client.runs.cancel(run.run_id)
Async Usage
import asyncio
from arga_sdk import AsyncArga
async def main():
client = AsyncArga(api_key="arga_...")
run = await client.runs.create_url_run(url="https://staging.myapp.com")
# Stream results
async for event in client.runs.stream_results(run.run_id):
print(event)
# Wait for completion
detail = await client.runs.wait(run.run_id)
print(detail.status)
await client.close()
asyncio.run(main())
Context Manager
Both clients support context managers to ensure proper cleanup:
with Arga(api_key="arga_...") as client:
run = client.runs.create_url_run(url="https://staging.myapp.com")
async with AsyncArga(api_key="arga_...") as client:
run = await client.runs.create_url_run(url="https://staging.myapp.com")
Available Methods
Runs
| Method | Description |
|---|---|
client.runs.create_url_run(url, ...) |
Test a live URL with browser validation |
client.runs.create_pr_run(repo, ...) |
Validate code changes from a PR or branch |
client.runs.create_agent_run(...) |
Deploy an autonomous agent for exploration |
client.runs.get(run_id) |
Get full run details |
client.runs.stream_results(run_id) |
Stream SSE result events |
client.runs.cancel(run_id) |
Cancel a running run |
client.runs.wait(run_id, ...) |
Poll until terminal status |
Twins
| Method | Description |
|---|---|
client.twins.list() |
List available service twins |
client.twins.provision(twins, ...) |
Provision twin instances |
client.twins.get_status(run_id) |
Get provisioning status |
client.twins.extend(run_id, ...) |
Extend twin TTL |
Scenarios
| Method | Description |
|---|---|
client.scenarios.create(name, ...) |
Create a test scenario |
client.scenarios.list(...) |
List scenarios (with optional filters) |
client.scenarios.get(scenario_id) |
Get a scenario by ID |
Error Handling
from arga_sdk import Arga, ArgaAPIError, ArgaError
client = Arga(api_key="arga_...")
try:
run = client.runs.get("nonexistent-id")
except ArgaAPIError as e:
print(e.status_code) # e.g. 404
print(e.message)
except ArgaError as e:
print(e.message)
Documentation
Full API documentation is available at docs.argalabs.com.
Project details
Release history Release notifications | RSS feed
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 arga_py_sdk-0.1.1.tar.gz.
File metadata
- Download URL: arga_py_sdk-0.1.1.tar.gz
- Upload date:
- Size: 31.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 |
593ceceaf58a9a0d7956c3863f96997fd3ddda930b26011bc3f7481eae05ef97
|
|
| MD5 |
c2bf51f50c22553126181d6ff26df942
|
|
| BLAKE2b-256 |
bbaf9660d2d98f93cf3359c32ce172918b2c561900e74da0659dfdaf53966ac5
|
Provenance
The following attestation bundles were made for arga_py_sdk-0.1.1.tar.gz:
Publisher:
publish.yml on ArgaLabs/arga-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arga_py_sdk-0.1.1.tar.gz -
Subject digest:
593ceceaf58a9a0d7956c3863f96997fd3ddda930b26011bc3f7481eae05ef97 - Sigstore transparency entry: 1239416582
- Sigstore integration time:
-
Permalink:
ArgaLabs/arga-python-sdk@153180c5e1f7652773dfba3ec2b700ea4af870f2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ArgaLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@153180c5e1f7652773dfba3ec2b700ea4af870f2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file arga_py_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: arga_py_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 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 |
5e404fe003ce430d18045c8d57e4a2767cdbc3eb362dbeb6cc70e93ff57c61fc
|
|
| MD5 |
f7b642dbb5ba5cd1a86ec052e6d3f616
|
|
| BLAKE2b-256 |
90588a1cb1e6f3bcdf33fd1736c3df4533c4536f65717ae47f188a59b6c1e7df
|
Provenance
The following attestation bundles were made for arga_py_sdk-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on ArgaLabs/arga-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arga_py_sdk-0.1.1-py3-none-any.whl -
Subject digest:
5e404fe003ce430d18045c8d57e4a2767cdbc3eb362dbeb6cc70e93ff57c61fc - Sigstore transparency entry: 1239416583
- Sigstore integration time:
-
Permalink:
ArgaLabs/arga-python-sdk@153180c5e1f7652773dfba3ec2b700ea4af870f2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ArgaLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@153180c5e1f7652773dfba3ec2b700ea4af870f2 -
Trigger Event:
push
-
Statement type: