vantage-python 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ id-token: write
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-22.04
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+ - run: pip install build twine
21
+ - run: pip install -e ".[dev]"
22
+ - run: python autogen.py
23
+ - run: python -m build
24
+ - name: Publish release distributions to PyPI
25
+ uses: pypa/gh-action-pypi-publish@v1.13.0
@@ -0,0 +1,36 @@
1
+ on: push
2
+ name: Run Tests
3
+
4
+ jobs:
5
+ e2e-tests:
6
+ name: E2E Tests (Python ${{ matrix.python-version }})
7
+ runs-on: ubuntu-22.04
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: ${{ matrix.python-version }}
16
+ - run: pip install -e ".[dev]"
17
+ - run: python autogen.py
18
+ - run: pytest tests/test_e2e.py
19
+ env:
20
+ VANTAGE_API_TOKEN: ${{ secrets.VANTAGE_API_TOKEN }}
21
+ VANTAGE_WORKSPACE_TOKEN: ${{ secrets.VANTAGE_WORKSPACE_TOKEN }}
22
+
23
+ dry-build:
24
+ name: Dry Build (Python ${{ matrix.python-version }})
25
+ runs-on: ubuntu-22.04
26
+ strategy:
27
+ matrix:
28
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+ - run: pip install -e ".[dev]"
35
+ - run: python autogen.py
36
+ - run: python -c "from vantage import Client, AsyncClient"
@@ -0,0 +1,12 @@
1
+ # Generated code
2
+ src/vantage/_types.py
3
+ src/vantage/_async/client.py
4
+ src/vantage/_sync/client.py
5
+
6
+ # Python specific
7
+ __pycache__/
8
+ dist/
9
+ build/
10
+ *.egg-info/
11
+ .pytest_cache/
12
+ .venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vantage
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,10 @@
1
+ .PHONY: install publish
2
+
3
+ install:
4
+ python3 autogen.py
5
+ python3 -m pip install -e ".[dev]"
6
+
7
+ publish:
8
+ python3 autogen.py
9
+ python3 -m build
10
+ twine upload dist/*
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: vantage-python
3
+ Version: 0.1.0
4
+ Summary: Python SDK for the Vantage API
5
+ Project-URL: Homepage, https://github.com/vantage-sh/vantage-python
6
+ Project-URL: Repository, https://github.com/vantage-sh/vantage-python
7
+ Author: Vantage
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: api,client,cloud,cost,sdk,vantage
11
+ Requires-Python: >=3.9
12
+ Requires-Dist: httpx>=0.27.0
13
+ Requires-Dist: pydantic>=2.0.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: build>=1.0.0; extra == 'dev'
16
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
17
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
18
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
19
+ Requires-Dist: twine>=6.0.0; extra == 'dev'
20
+ Description-Content-Type: text/markdown
21
+
22
+ # vantage-python
23
+
24
+ A Python SDK for the [Vantage](https://vantage.sh) API. Types and client methods are auto-generated from the official OpenAPI specification.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install vantage-python
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ### Synchronous Client
35
+
36
+ ```python
37
+ from vantage import Client
38
+
39
+ client = Client("your-api-token")
40
+
41
+ # List resources with query parameters
42
+ reports = client.cost_reports.list(page=1)
43
+
44
+ # Get a specific resource by token
45
+ report = client.cost_reports.get("rprt_abc123")
46
+
47
+ # Create a new resource
48
+ folder = client.folders.create(CreateFolder(
49
+ title="Production Costs",
50
+ workspace_token="wrkspc_123",
51
+ ))
52
+
53
+ # Update a resource
54
+ client.folders.update("fldr_abc123", UpdateFolder(
55
+ title="Updated Title",
56
+ ))
57
+
58
+ # Delete a resource
59
+ client.folders.delete("fldr_abc123")
60
+ ```
61
+
62
+ ### Async Client
63
+
64
+ ```python
65
+ from vantage import AsyncClient
66
+
67
+ async with AsyncClient("your-api-token") as client:
68
+ folders = await client.folders.list()
69
+
70
+ folder = await client.folders.create(CreateFolder(
71
+ title="Production Costs",
72
+ workspace_token="wrkspc_123",
73
+ ))
74
+ ```
75
+
76
+ ## Error Handling
77
+
78
+ API errors are raised as `VantageAPIError` with structured error information:
79
+
80
+ ```python
81
+ from vantage import Client, VantageAPIError
82
+
83
+ try:
84
+ client.cost_reports.get("invalid_token")
85
+ except VantageAPIError as e:
86
+ print(e.status) # 404
87
+ print(e.status_text) # "Not Found"
88
+ print(e.errors) # ["Resource not found"] or None
89
+ ```
90
+
91
+ ## Development
92
+
93
+ ### Building
94
+
95
+ ```bash
96
+ make install
97
+ ```
98
+
99
+ This 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.
100
+
101
+ ### Testing
102
+
103
+ ```bash
104
+ pytest
105
+ ```
106
+
107
+ ### Publishing
108
+
109
+ ```bash
110
+ make publish
111
+ ```
@@ -0,0 +1,90 @@
1
+ # vantage-python
2
+
3
+ A Python SDK for the [Vantage](https://vantage.sh) API. Types and client methods are auto-generated from the official OpenAPI specification.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install vantage-python
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Synchronous Client
14
+
15
+ ```python
16
+ from vantage import Client
17
+
18
+ client = Client("your-api-token")
19
+
20
+ # List resources with query parameters
21
+ reports = client.cost_reports.list(page=1)
22
+
23
+ # Get a specific resource by token
24
+ report = client.cost_reports.get("rprt_abc123")
25
+
26
+ # Create a new resource
27
+ folder = client.folders.create(CreateFolder(
28
+ title="Production Costs",
29
+ workspace_token="wrkspc_123",
30
+ ))
31
+
32
+ # Update a resource
33
+ client.folders.update("fldr_abc123", UpdateFolder(
34
+ title="Updated Title",
35
+ ))
36
+
37
+ # Delete a resource
38
+ client.folders.delete("fldr_abc123")
39
+ ```
40
+
41
+ ### Async Client
42
+
43
+ ```python
44
+ from vantage import AsyncClient
45
+
46
+ async with AsyncClient("your-api-token") as client:
47
+ folders = await client.folders.list()
48
+
49
+ folder = await client.folders.create(CreateFolder(
50
+ title="Production Costs",
51
+ workspace_token="wrkspc_123",
52
+ ))
53
+ ```
54
+
55
+ ## Error Handling
56
+
57
+ API errors are raised as `VantageAPIError` with structured error information:
58
+
59
+ ```python
60
+ from vantage import Client, VantageAPIError
61
+
62
+ try:
63
+ client.cost_reports.get("invalid_token")
64
+ except VantageAPIError as e:
65
+ print(e.status) # 404
66
+ print(e.status_text) # "Not Found"
67
+ print(e.errors) # ["Resource not found"] or None
68
+ ```
69
+
70
+ ## Development
71
+
72
+ ### Building
73
+
74
+ ```bash
75
+ make install
76
+ ```
77
+
78
+ This 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.
79
+
80
+ ### Testing
81
+
82
+ ```bash
83
+ pytest
84
+ ```
85
+
86
+ ### Publishing
87
+
88
+ ```bash
89
+ make publish
90
+ ```