Skip to main content

Python SDK for the Vantage API

Project description

vantage-python

A Python SDK for the Vantage API. Types and client methods are auto-generated from the official OpenAPI specification.

Installation

pip install vantage-python

Usage

Synchronous Client

from 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")

Async Client

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",
    ))

Error Handling

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 None

Development

Building

make install

This 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.

Testing

pytest

Publishing

make publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vantage_python-0.3.2.tar.gz (47.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vantage_python-0.3.2-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file vantage_python-0.3.2.tar.gz.

File metadata

  • Download URL: vantage_python-0.3.2.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vantage_python-0.3.2.tar.gz
Algorithm Hash digest
SHA256 b442398fabc24dd52ac4f32a64dae78f1d1d6a8111130cdf369724d9602362c5
MD5 4ab1fc4a0b455bf7a8c9b0fad004f5ea
BLAKE2b-256 4fc363f240436f7e00dbdf5df8b53b1b8e22ababea2bfb294dd40d9ea94b745b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vantage_python-0.3.2.tar.gz:

Publisher: pypi-publish.yml on vantage-sh/vantage-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vantage_python-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: vantage_python-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vantage_python-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dbe5cb13c2baa52683f3a3712eeb084be4d178018ce06b9e6befccf7cbe26300
MD5 b39c154969169526b85fef1c4c052dc1
BLAKE2b-256 28583075a38cf53c8b6b9ed589627398fd0fc94dcf89df4387e2e1fddeb1703a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vantage_python-0.3.2-py3-none-any.whl:

Publisher: pypi-publish.yml on vantage-sh/vantage-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page