BambooSnow Python SDK
Official Python SDK for the BambooSnow AI agent automation platform.
Installation
pip install bamboosnow
Quick Start
from bamboosnow import BambooSnowClient
# Using environment variable BAMBOOSNOW_API_KEY
client = BambooSnowClient()
# Or pass the API key directly
client = BambooSnowClient(api_key="bs_...")
# List your agents
agents = client.agents.list()
for agent in agents.items:
print(f"{agent.name}: {agent.status}")
# Get a specific run
run = client.runs.get("run_abc123")
print(f"Status: {run.status}, Tokens: {run.tokens_used}")
# Approve a pending action
client.runs.approve("run_abc123", approved=True, comment="Looks good!")
Async Support
The SDK includes full async support:
import asyncio
from bamboosnow import AsyncBambooSnowClient
async def main():
async with AsyncBambooSnowClient() as client:
agents = await client.agents.list()
for agent in agents.items:
print(f"{agent.name}: {agent.status}")
asyncio.run(main())
Resources
Agents
# List agents
agents = client.agents.list(status="deployed")
# Get agent details
agent = client.agents.get("agt_abc123")
# Pause/resume agents
client.agents.pause("agt_abc123")
client.agents.resume("agt_abc123")
# Get agent health
health = client.agents.get_health("agt_abc123")
print(f"Grade: {health.grade}, Score: {health.overall_score}")
# Trigger a manual run
result = client.agents.trigger("agt_abc123", {"pr_number": 42})
print(f"Run ID: {result['run_id']}")
# List templates
templates = client.agents.list_templates()
Runs
# List runs
runs = client.runs.list(agent_id="agt_abc123")
# Get run details with thought trace
run = client.runs.get("run_abc123")
for step in run.thought_trace:
print(f"[{step.type}] {step.content}")
# Approve/reject pending actions
client.runs.approve("run_abc123", approved=True)
client.runs.approve("run_abc123", approved=False, comment="Too risky")
# Cancel a running job
client.runs.cancel("run_abc123", reason="No longer needed")
# Wait for completion
run = client.runs.wait_for_completion(
"run_abc123",
on_progress=lambda r: print(f"Status: {r.status}")
)
# Get runs pending approval
pending = client.runs.get_pending_approvals()
Repositories
# List connected repos
repos = client.repositories.list()
# Connect a repository
repo = client.repositories.connect(
provider="github",
full_name="myorg/myrepo"
)
# Run analysis
analysis = client.repositories.analyze(repo.id)
# Wait for analysis to complete
analysis = client.repositories.wait_for_analysis(
analysis.id,
on_progress=lambda a: print(f"{a.progress_percent}% complete")
)
# Get latest analysis
latest = client.repositories.get_latest_analysis(repo.id)
API Keys
# List keys
keys = client.api_keys.list()
# Create a new key
result = client.api_keys.create(name="CI/CD Key")
print(f"Key: {result['key']}") # Only shown once!
# Revoke a key
client.api_keys.revoke("key_abc123")
Configuration
Environment Variables
BAMBOOSNOW_API_KEY: Your API keyBAMBOOSNOW_BASE_URL: Custom API base URL (for self-hosted)
Client Options
client = BambooSnowClient(
api_key="bs_...",
base_url="https://api.bamboosnow.co", # or self-hosted URL
timeout=60.0, # request timeout in seconds
max_retries=3, # retry attempts for failed requests
)
Error Handling
from bamboosnow import BambooSnowClient
from bamboosnow.errors import (
APIError,
AuthenticationError,
NotFoundError,
RateLimitError,
ValidationError,
)
client = BambooSnowClient()
try:
agent = client.agents.get("agt_abc123")
except AuthenticationError:
print("Invalid API key")
except NotFoundError:
print("Agent not found")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after} seconds")
except ValidationError as e:
print(f"Validation error: {e.errors}")
except APIError as e:
print(f"API error: {e.message}")
Type Hints
The SDK is fully typed. All models are Pydantic v2 models with full IDE support:
from bamboosnow import Agent, AgentStatus
def process_agent(agent: Agent) -> None:
if agent.status == AgentStatus.DEPLOYED:
print(f"{agent.name} is running")
License
MIT
Metadata
Release files for bamboosnow 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bamboosnow-0.1.0.tar.gz | 13.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bamboosnow-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.1 kB
Release files / bamboosnow-0.1.0.tar.gz
| Download URL | bamboosnow-0.1.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87157e9a6dbba7d3fd02869f4f845c5a92196c8434591ccbd939b485adef5409
|
|
BLAKE2b-256 checksum How to use checksums |
154a2f35813117b89aa6219e5a9ae60fc06efcb6df16b959847b7cfdd430e577
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 18, 2026.
Transparency logRelease files / bamboosnow-0.1.0-py3-none-any.whl
| Download URL | bamboosnow-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1cee1b44b722239b9b8df99e44e0dce13abd9dbeae0ed8930e98c397da3d0cb9
|
|
BLAKE2b-256 checksum How to use checksums |
35333bcc1ba310a87544d9cc17f5c40fdc21be9eb2f062b9f2949750b22732cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 18, 2026.
Transparency logSecurity for bamboosnow 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for bamboosnow-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 18, 2026.
Transparency logA 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.