A Python SDK for the Vantage API. Types and client methods are auto-generated from the official OpenAPI specification.
pip install vantage-pythonfrom vantage import Client
client = Client("your-api-token")
# List resources with query parameters
reports = client.cost_reports.list(page=1)
# Get a specific resource by token
report = client.cost_reports.get("rprt_abc123")
# Create a new resource
folder = client.folders.create(CreateFolder(
title="Production Costs",
workspace_token="wrkspc_123",
))
# Update a resource
client.folders.update("fldr_abc123", UpdateFolder(
title="Updated Title",
))
# Delete a resource
client.folders.delete("fldr_abc123")from vantage import AsyncClient
async with AsyncClient("your-api-token") as client:
folders = await client.folders.list()
folder = await client.folders.create(CreateFolder(
title="Production Costs",
workspace_token="wrkspc_123",
))API errors are raised as VantageAPIError with structured error information:
from vantage import Client, VantageAPIError
try:
client.cost_reports.get("invalid_token")
except VantageAPIError as e:
print(e.status) # 404
print(e.status_text) # "Not Found"
print(e.errors) # ["Resource not found"] or Nonemake installThis fetches the latest OpenAPI schema from the Vantage API and generates Pydantic models, sync client, and async client. Your pip version will need to be up to date for this.
pytestmake publish