Install
pip install orgs-sdk
# or with uv
uv add orgs-sdk
Quick start
from orgs import Client
orgs = Client(api_key=os.environ["ORGS_API_KEY"])
# List entities
for entity in orgs.entity.list():
print(f"{entity.did}: {entity.name}")
# Create a proposal
proposal = orgs.proposal.create(
entity="helios-research",
kind={
"type": "spend",
"amount_usd": 12_500,
"recipient": "aws-bedrock",
"description": "Q2 compute reservation",
},
)
# Vote
orgs.proposal.vote(
proposal.id,
choice="approve",
reason="Within Q2 budget",
)
Async API
from orgs.async_ import AsyncClient
async def main():
async with AsyncClient(api_key=...) as orgs:
entities = await orgs.entity.list()
Pydantic types
All response types are Pydantic models:from orgs.types import Entity, Proposal
def format_entity(e: Entity) -> str:
return f"{e.did}: {e.name}"
Error handling
from orgs import OrgsError, InsufficientFundsError
try:
orgs.treasury.disburse(...)
except InsufficientFundsError as e:
print(f"Not enough: ${e.requested} > ${e.available}")
except OrgsError as e:
print(f"Other error: {e}")
Pandas interop
import pandas as pd
history = orgs.treasury.history(entity="helios-research")
df = pd.DataFrame([t.dict() for t in history])