A Python SDK for the Vantage API. Types and client methods are auto-generated from the official OpenAPI specification.
pip install vantage-pythonfromvantageimportClientclient=Client("your-api-token")
# List resources with query parametersreports=client.cost_reports.list(page=1)
# Get a specific resource by tokenreport=client.cost_reports.get("rprt_abc123")
# Create a new resourcefolder=client.folders.create(CreateFolder(
title="Production Costs",
workspace_token="wrkspc_123",
))
# Update a resourceclient.folders.update("fldr_abc123", UpdateFolder(
title="Updated Title",
))
# Delete a resourceclient.folders.delete("fldr_abc123")fromvantageimportAsyncClientasyncwithAsyncClient("your-api-token") asclient:
folders=awaitclient.folders.list()
folder=awaitclient.folders.create(CreateFolder(
title="Production Costs",
workspace_token="wrkspc_123",
))API errors are raised as VantageAPIError with structured error information:
fromvantageimportClient, VantageAPIErrortry:
client.cost_reports.get("invalid_token")
exceptVantageAPIErrorase:
print(e.status) # 404print(e.status_text) # "Not Found"print(e.errors) # ["Resource not found"] or Nonemake installThis generates Pydantic models, sync client, and the async client. Your pip version will need to be up to date for this. If you wish to generate the client first, you should use make generate.
pytestmake publish