facesign-sdk 0.0.3__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.
- facesign_sdk-0.0.3/PKG-INFO +114 -0
- facesign_sdk-0.0.3/README.md +95 -0
- facesign_sdk-0.0.3/facesign_sdk/__init__.py +20 -0
- facesign_sdk-0.0.3/facesign_sdk/client.py +1504 -0
- facesign_sdk-0.0.3/facesign_sdk/credentials.py +70 -0
- facesign_sdk-0.0.3/facesign_sdk/py.typed +0 -0
- facesign_sdk-0.0.3/pyproject.toml +34 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: facesign-sdk
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: A Python client for the FaceSign API.
|
|
5
|
+
Keywords: facesign,sdk,client,api
|
|
6
|
+
Author: FaceSign
|
|
7
|
+
Requires-Python: >=3.12
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Dist: httpx (>=0.27,<1.0)
|
|
15
|
+
Requires-Dist: pydantic (>=2.0,<3.0)
|
|
16
|
+
Project-URL: Repository, https://github.com/facesignai/FaceSign.SDK
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# facesign-sdk
|
|
20
|
+
|
|
21
|
+
A Python client for the [FaceSign](https://facesign.ai) API.
|
|
22
|
+
|
|
23
|
+
Asynchronous (built on [`httpx`](https://www.python-httpx.org/)) and typed (ships `py.typed`).
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- Python **3.12+**
|
|
28
|
+
- `httpx`, `pydantic` (installed automatically)
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
pip install facesign-sdk
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Authentication
|
|
37
|
+
|
|
38
|
+
The SDK resolves your API key via `Credentials.default()`, which checks, in order:
|
|
39
|
+
|
|
40
|
+
1. The `FACESIGN_API_KEY` environment variable
|
|
41
|
+
2. `~/.config/facesign/$FACESIGN_PROJECT/api_key`
|
|
42
|
+
|
|
43
|
+
The base URL is resolved from the `FACESIGN_API_URL` environment variable or
|
|
44
|
+
`~/.config/facesign/$FACESIGN_PROJECT/config.json` (`api_url`), defaulting to
|
|
45
|
+
`https://api.facesign.ai`. Pass it explicitly to the client below.
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
import asyncio
|
|
51
|
+
from facesign_sdk.client import Client, ClientOptions
|
|
52
|
+
from facesign_sdk.credentials import Credentials
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
async def main() -> None:
|
|
56
|
+
client = Client(
|
|
57
|
+
ClientOptions(
|
|
58
|
+
creds=Credentials.default(),
|
|
59
|
+
base_url="https://api.facesign.ai",
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
result = await client.list_users()
|
|
64
|
+
if result.status_code == 200 and result.data is not None:
|
|
65
|
+
print(result.data)
|
|
66
|
+
else:
|
|
67
|
+
print(result.error or result.response_body)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
asyncio.run(main())
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Every method returns a `ClientResponse[TData, TError]` with:
|
|
74
|
+
|
|
75
|
+
- `status_code: int`
|
|
76
|
+
- `data: TData | None` — the parsed response body on success
|
|
77
|
+
- `error: TError | None` — a parsed `ErrorResponse` on failure
|
|
78
|
+
- `response_body: str | None` — the raw response body
|
|
79
|
+
|
|
80
|
+
## Available methods
|
|
81
|
+
|
|
82
|
+
| Method | Description |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `list_users()` | List users |
|
|
85
|
+
| `get_user_api_keys(user_id)` | List a user's API keys |
|
|
86
|
+
| `create_user_api_key(user_id, body)` | Create a user API key |
|
|
87
|
+
| `revoke_user_api_key(id, user_id)` | Revoke a user API key |
|
|
88
|
+
| `list_avatars()` | List avatars |
|
|
89
|
+
| `create_avatar(body)` | Create an avatar |
|
|
90
|
+
| `get_avatar(id)` | Get an avatar |
|
|
91
|
+
| `update_avatar(id, body)` | Update an avatar |
|
|
92
|
+
| `delete_avatar(id)` | Delete an avatar |
|
|
93
|
+
| `create_session(body)` | Create a session |
|
|
94
|
+
| `start_session()` | Start a session |
|
|
95
|
+
| `create_session_prop(id, body)` | Create a session prop |
|
|
96
|
+
| `get_session_detail(session_id)` | Get session detail |
|
|
97
|
+
| `list_session_utterances(session_id)` | List session utterances |
|
|
98
|
+
| `get_demo_report(session_id)` | Get a demo report |
|
|
99
|
+
|
|
100
|
+
Request/response models are available in `facesign_sdk.client` (e.g.
|
|
101
|
+
`from facesign_sdk.client import ListUsersResponse`).
|
|
102
|
+
|
|
103
|
+
## Development
|
|
104
|
+
|
|
105
|
+
This package is generated from the OpenAPI spec via [`uni`](../uni.toml). To
|
|
106
|
+
regenerate the client, run `make gen` from the repository root (it writes to
|
|
107
|
+
`facesign_sdk/client.py`).
|
|
108
|
+
|
|
109
|
+
To build a distribution locally:
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
python -m build # produces dist/*.whl and dist/*.tar.gz
|
|
113
|
+
```
|
|
114
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# facesign-sdk
|
|
2
|
+
|
|
3
|
+
A Python client for the [FaceSign](https://facesign.ai) API.
|
|
4
|
+
|
|
5
|
+
Asynchronous (built on [`httpx`](https://www.python-httpx.org/)) and typed (ships `py.typed`).
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Python **3.12+**
|
|
10
|
+
- `httpx`, `pydantic` (installed automatically)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pip install facesign-sdk
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Authentication
|
|
19
|
+
|
|
20
|
+
The SDK resolves your API key via `Credentials.default()`, which checks, in order:
|
|
21
|
+
|
|
22
|
+
1. The `FACESIGN_API_KEY` environment variable
|
|
23
|
+
2. `~/.config/facesign/$FACESIGN_PROJECT/api_key`
|
|
24
|
+
|
|
25
|
+
The base URL is resolved from the `FACESIGN_API_URL` environment variable or
|
|
26
|
+
`~/.config/facesign/$FACESIGN_PROJECT/config.json` (`api_url`), defaulting to
|
|
27
|
+
`https://api.facesign.ai`. Pass it explicitly to the client below.
|
|
28
|
+
|
|
29
|
+
## Quickstart
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import asyncio
|
|
33
|
+
from facesign_sdk.client import Client, ClientOptions
|
|
34
|
+
from facesign_sdk.credentials import Credentials
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
async def main() -> None:
|
|
38
|
+
client = Client(
|
|
39
|
+
ClientOptions(
|
|
40
|
+
creds=Credentials.default(),
|
|
41
|
+
base_url="https://api.facesign.ai",
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
result = await client.list_users()
|
|
46
|
+
if result.status_code == 200 and result.data is not None:
|
|
47
|
+
print(result.data)
|
|
48
|
+
else:
|
|
49
|
+
print(result.error or result.response_body)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
asyncio.run(main())
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Every method returns a `ClientResponse[TData, TError]` with:
|
|
56
|
+
|
|
57
|
+
- `status_code: int`
|
|
58
|
+
- `data: TData | None` — the parsed response body on success
|
|
59
|
+
- `error: TError | None` — a parsed `ErrorResponse` on failure
|
|
60
|
+
- `response_body: str | None` — the raw response body
|
|
61
|
+
|
|
62
|
+
## Available methods
|
|
63
|
+
|
|
64
|
+
| Method | Description |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| `list_users()` | List users |
|
|
67
|
+
| `get_user_api_keys(user_id)` | List a user's API keys |
|
|
68
|
+
| `create_user_api_key(user_id, body)` | Create a user API key |
|
|
69
|
+
| `revoke_user_api_key(id, user_id)` | Revoke a user API key |
|
|
70
|
+
| `list_avatars()` | List avatars |
|
|
71
|
+
| `create_avatar(body)` | Create an avatar |
|
|
72
|
+
| `get_avatar(id)` | Get an avatar |
|
|
73
|
+
| `update_avatar(id, body)` | Update an avatar |
|
|
74
|
+
| `delete_avatar(id)` | Delete an avatar |
|
|
75
|
+
| `create_session(body)` | Create a session |
|
|
76
|
+
| `start_session()` | Start a session |
|
|
77
|
+
| `create_session_prop(id, body)` | Create a session prop |
|
|
78
|
+
| `get_session_detail(session_id)` | Get session detail |
|
|
79
|
+
| `list_session_utterances(session_id)` | List session utterances |
|
|
80
|
+
| `get_demo_report(session_id)` | Get a demo report |
|
|
81
|
+
|
|
82
|
+
Request/response models are available in `facesign_sdk.client` (e.g.
|
|
83
|
+
`from facesign_sdk.client import ListUsersResponse`).
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
This package is generated from the OpenAPI spec via [`uni`](../uni.toml). To
|
|
88
|
+
regenerate the client, run `make gen` from the repository root (it writes to
|
|
89
|
+
`facesign_sdk/client.py`).
|
|
90
|
+
|
|
91
|
+
To build a distribution locally:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
python -m build # produces dist/*.whl and dist/*.tar.gz
|
|
95
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""FaceSign Python SDK.
|
|
2
|
+
|
|
3
|
+
An asynchronous client for the FaceSign API.
|
|
4
|
+
|
|
5
|
+
The public API lives in two submodules:
|
|
6
|
+
|
|
7
|
+
- ``facesign_sdk.client`` -- the ``Client``, its ``ClientOptions`` /
|
|
8
|
+
``ClientCredentials``, and all request/response models.
|
|
9
|
+
- ``facesign_sdk.credentials`` -- credential resolution (``Credentials``).
|
|
10
|
+
|
|
11
|
+
Example::
|
|
12
|
+
|
|
13
|
+
from facesign_sdk.client import Client, ClientOptions
|
|
14
|
+
from facesign_sdk.credentials import Credentials
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from . import client
|
|
18
|
+
from . import credentials
|
|
19
|
+
|
|
20
|
+
__all__ = ["client", "credentials"]
|