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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vantage_python-0.3.1.tar.gz.
File metadata
- Download URL: vantage_python-0.3.1.tar.gz
- Upload date:
- Size: 46.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e25fa1af6a5a058b74b4b4b7d52b133da3644f2f9b2a313654d7e2461effd25d
|
|
| MD5 |
eb5b64985bff9f3d75b37c1a58ec0132
|
|
| BLAKE2b-256 |
8f4f2396e0deb714f247f74216b229ca8ee3ecef386ff94163ba1dff81af4910
|
Provenance
The following attestation bundles were made for vantage_python-0.3.1.tar.gz:
Publisher:
pypi-publish.yml on vantage-sh/vantage-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vantage_python-0.3.1.tar.gz -
Subject digest:
e25fa1af6a5a058b74b4b4b7d52b133da3644f2f9b2a313654d7e2461effd25d - Sigstore transparency entry: 974764056
- Sigstore integration time:
-
Permalink:
vantage-sh/vantage-python@7145471f57973b8342e2ebb401c58877d9e0a3ba -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vantage-sh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@7145471f57973b8342e2ebb401c58877d9e0a3ba -
Trigger Event:
push
-
Statement type:
File details
Details for the file vantage_python-0.3.1-py3-none-any.whl.
File metadata
- Download URL: vantage_python-0.3.1-py3-none-any.whl
- Upload date:
- Size: 40.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebb21b5738c10417f98641f15d76ef221147d2f500c8eef625abd722f91a9762
|
|
| MD5 |
d928204a5c368d05f0df285c35a13ea4
|
|
| BLAKE2b-256 |
dcbb9ee769cac060edb3eff72168cc4abdd214982fbb0c9e06e1d77c731c920c
|
Provenance
The following attestation bundles were made for vantage_python-0.3.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on vantage-sh/vantage-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vantage_python-0.3.1-py3-none-any.whl -
Subject digest:
ebb21b5738c10417f98641f15d76ef221147d2f500c8eef625abd722f91a9762 - Sigstore transparency entry: 974764083
- Sigstore integration time:
-
Permalink:
vantage-sh/vantage-python@7145471f57973b8342e2ebb401c58877d9e0a3ba -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vantage-sh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@7145471f57973b8342e2ebb401c58877d9e0a3ba -
Trigger Event:
push
-
Statement type: