ourseams-sdk 0.1.0__py3-none-any.whl
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.
- ourseams_sdk-0.1.0.dist-info/METADATA +60 -0
- ourseams_sdk-0.1.0.dist-info/RECORD +10 -0
- ourseams_sdk-0.1.0.dist-info/WHEEL +4 -0
- ourseams_sdk-0.1.0.dist-info/licenses/LICENSE +21 -0
- seams/__init__.py +55 -0
- seams/_generated/__init__.py +0 -0
- seams/_generated/client.py +1205 -0
- seams/_generated/models.py +1240 -0
- seams/_transport.py +120 -0
- seams/py.typed +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ourseams-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The typed Python client for the seams control plane, generated from its OpenAPI document.
|
|
5
|
+
Project-URL: Homepage, https://ourseams.com
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Requires-Dist: httpx<1,>=0.27
|
|
10
|
+
Requires-Dist: pydantic<3,>=2.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# seams
|
|
14
|
+
|
|
15
|
+
The typed Python client for the seams control plane. **Generated from the OpenAPI document**, which is
|
|
16
|
+
emitted from the API's route table — so it cannot describe a shape the API does not serve, and it stays
|
|
17
|
+
in step with `@ourseams/sdk`.
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
import os
|
|
21
|
+
from seams import Seams
|
|
22
|
+
|
|
23
|
+
seams = Seams(api_key=os.environ["SEAMS_SECRET_KEY"])
|
|
24
|
+
|
|
25
|
+
seams.users.create("alice", models.CreateEndUserRequest(email="alice@firm.com"))
|
|
26
|
+
key = seams.keys.mint(models.MintKeyRequest(end_user_id="alice", bundle="pro"))
|
|
27
|
+
print(key.key)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## One namespace per CLI command group
|
|
31
|
+
|
|
32
|
+
`operationId` carries the CLI's own verb, so the method reads like the command:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
seams models add smart … → seams.models.add("smart", …)
|
|
36
|
+
seams bundles price pro fast … → seams.bundles.price("pro", …)
|
|
37
|
+
seams outcomes runs → seams.outcomes.runs()
|
|
38
|
+
seams usage --by model → seams.usage(by="model")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Top-level commands stay top-level: `usage`, `margin`, `audit`, `doctor`, `capabilities`. Routes the API
|
|
42
|
+
serves but does not offer a client carry `x-seams-internal: true` and get no method.
|
|
43
|
+
|
|
44
|
+
## Sync and async
|
|
45
|
+
|
|
46
|
+
`Seams` and `AsyncSeams` are generated from the same document and carry the same 76 methods.
|
|
47
|
+
|
|
48
|
+
## Two runtime dependencies
|
|
49
|
+
|
|
50
|
+
`httpx` for the transport and `pydantic` for the models. Field names are Python's — `end_users`, not
|
|
51
|
+
`endUsers` — with the wire name kept as an alias.
|
|
52
|
+
|
|
53
|
+
## Regenerating
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
uv run python scripts/generate.py # models and facade
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`src/seams/_generated/` is written by the generator. Do not edit it. The document it reads,
|
|
60
|
+
`../openapi.json`, is emitted by [the TypeScript client](../typescript) from the API's route table.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
seams/__init__.py,sha256=z2-CZy7ibTT-1bVAC62UXWWKSXBDZMOEA7mmWcW4wzA,1458
|
|
2
|
+
seams/_transport.py,sha256=GunsrDZuU8S60Clak0F9cxhCpClGj9NRBVXFmONfLnU,3589
|
|
3
|
+
seams/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
seams/_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
seams/_generated/client.py,sha256=PBATmHBw6Em9F0oRoRLOWoTXBdqc9CsjfWwJr1xy8BE,44046
|
|
6
|
+
seams/_generated/models.py,sha256=AaLUeUb_ie6vYrbr_34lJu_EF4yJ-dJBY5Ki6v9mYFk,35757
|
|
7
|
+
ourseams_sdk-0.1.0.dist-info/METADATA,sha256=-YZ7Dq2pgWeSdaE7TC3hrK9Rj7hrbm0dgs_5TMfl1iI,2063
|
|
8
|
+
ourseams_sdk-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
9
|
+
ourseams_sdk-0.1.0.dist-info/licenses/LICENSE,sha256=7tGH164rlpABjKpS4F8c5gvvZ52M23vUFAJmZTRVR1U,1062
|
|
10
|
+
ourseams_sdk-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Seams
|
|
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.
|
seams/__init__.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""The seams control plane, one namespace per CLI command group."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ._generated import models
|
|
8
|
+
from ._generated.client import AsyncSurface, Surface
|
|
9
|
+
from ._transport import DEFAULT_BASE_URL, AsyncTransport, SeamsError, Transport
|
|
10
|
+
|
|
11
|
+
__all__ = ["AsyncSeams", "Seams", "SeamsError", "models"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Seams(Surface):
|
|
15
|
+
"""
|
|
16
|
+
>>> seams = Seams(api_key=os.environ["SEAMS_SECRET_KEY"])
|
|
17
|
+
>>> seams.users.create("alice", email="alice@firm.com")
|
|
18
|
+
>>> seams.keys.mint(end_user_id="alice", bundle="pro").key
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
api_key: str,
|
|
24
|
+
base_url: str = DEFAULT_BASE_URL,
|
|
25
|
+
http_client: httpx.Client | None = None,
|
|
26
|
+
) -> None:
|
|
27
|
+
super().__init__(Transport(api_key, base_url, http_client))
|
|
28
|
+
|
|
29
|
+
def close(self) -> None:
|
|
30
|
+
self._t.close()
|
|
31
|
+
|
|
32
|
+
def __enter__(self) -> Seams:
|
|
33
|
+
return self
|
|
34
|
+
|
|
35
|
+
def __exit__(self, *_: object) -> None:
|
|
36
|
+
self.close()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class AsyncSeams(AsyncSurface):
|
|
40
|
+
def __init__(
|
|
41
|
+
self,
|
|
42
|
+
api_key: str,
|
|
43
|
+
base_url: str = DEFAULT_BASE_URL,
|
|
44
|
+
http_client: httpx.AsyncClient | None = None,
|
|
45
|
+
) -> None:
|
|
46
|
+
super().__init__(AsyncTransport(api_key, base_url, http_client))
|
|
47
|
+
|
|
48
|
+
async def aclose(self) -> None:
|
|
49
|
+
await self._t.aclose()
|
|
50
|
+
|
|
51
|
+
async def __aenter__(self) -> AsyncSeams:
|
|
52
|
+
return self
|
|
53
|
+
|
|
54
|
+
async def __aexit__(self, *_: object) -> None:
|
|
55
|
+
await self.aclose()
|
|
File without changes
|