woku 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.
- woku-0.1.0/.gitignore +24 -0
- woku-0.1.0/LICENSE +21 -0
- woku-0.1.0/PKG-INFO +171 -0
- woku-0.1.0/README.md +145 -0
- woku-0.1.0/openapi/openapi-v1.json +6773 -0
- woku-0.1.0/pyproject.toml +91 -0
- woku-0.1.0/scripts/generate_models.sh +46 -0
- woku-0.1.0/src/woku/__init__.py +56 -0
- woku-0.1.0/src/woku/_base_client.py +156 -0
- woku-0.1.0/src/woku/_client.py +351 -0
- woku-0.1.0/src/woku/_exceptions.py +185 -0
- woku-0.1.0/src/woku/_generated/__init__.py +4 -0
- woku-0.1.0/src/woku/_generated/models.py +1129 -0
- woku-0.1.0/src/woku/_options.py +25 -0
- woku-0.1.0/src/woku/_pagination.py +135 -0
- woku-0.1.0/src/woku/_version.py +3 -0
- woku-0.1.0/src/woku/models.py +214 -0
- woku-0.1.0/src/woku/py.typed +0 -0
- woku-0.1.0/src/woku/resources/__init__.py +72 -0
- woku-0.1.0/src/woku/resources/action_plans.py +459 -0
- woku-0.1.0/src/woku/resources/company.py +57 -0
- woku-0.1.0/src/woku/resources/dispatches.py +81 -0
- woku-0.1.0/src/woku/resources/flows.py +55 -0
- woku-0.1.0/src/woku/resources/forms.py +106 -0
- woku-0.1.0/src/woku/resources/quarantines.py +50 -0
- woku-0.1.0/src/woku/resources/reports.py +74 -0
- woku-0.1.0/src/woku/resources/surveys.py +199 -0
- woku-0.1.0/src/woku/resources/tickets.py +246 -0
- woku-0.1.0/src/woku/resources/trackers.py +364 -0
- woku-0.1.0/src/woku/resources/voc_tools.py +283 -0
- woku-0.1.0/src/woku/resources/wokus.py +226 -0
- woku-0.1.0/src/woku/types.py +52 -0
woku-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
.mypy_cache/
|
|
11
|
+
.pyright/
|
|
12
|
+
|
|
13
|
+
# Environments
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
.env
|
|
17
|
+
|
|
18
|
+
# uv
|
|
19
|
+
uv.lock
|
|
20
|
+
|
|
21
|
+
# OS / editors
|
|
22
|
+
.DS_Store
|
|
23
|
+
.idea/
|
|
24
|
+
.vscode/
|
woku-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Woku
|
|
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.
|
woku-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: woku
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official server-side SDK for the Woku management API (trackers, VoC tools, action plans, tickets, delivery and capture over /v1).
|
|
5
|
+
Project-URL: Homepage, https://woku.app
|
|
6
|
+
Project-URL: Repository, https://github.com/wokuApp/woku-python
|
|
7
|
+
Project-URL: Issues, https://github.com/wokuApp/woku-python/issues
|
|
8
|
+
Author: Woku
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api,ces,csat,customer-feedback,nps,sdk,voice-of-customer,woku
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: httpx>=0.24
|
|
24
|
+
Requires-Dist: pydantic>=2
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
|
|
29
|
+
# woku
|
|
30
|
+
|
|
31
|
+
Official **server-side** SDK for the [Woku](https://woku.app) management API.
|
|
32
|
+
|
|
33
|
+
[](https://pypi.org/project/woku/)
|
|
34
|
+
[](https://pypi.org/project/woku/)
|
|
35
|
+
[](./LICENSE)
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
## Why
|
|
40
|
+
|
|
41
|
+
Manage your entire Woku account from your backend with one typed client:
|
|
42
|
+
trackers, VoC tools (NPS/CSAT/CES), wokus, forms, flows, action plans,
|
|
43
|
+
support tickets, delivery tracking and survey sends over the public `/v1` API.
|
|
44
|
+
|
|
45
|
+
- **Sync and async** clients (`Woku` / `AsyncWoku`) on top of `httpx`.
|
|
46
|
+
- **Typed** request bodies (Pydantic v2 models generated from the OpenAPI spec)
|
|
47
|
+
and response shapes.
|
|
48
|
+
- **Automatic retries** with full-jitter backoff and `Retry-After` support.
|
|
49
|
+
- **Idempotent creates**: creates carry an auto-generated `Idempotency-Key`, so
|
|
50
|
+
a retry after a blip never creates twice. Action calls (`send`, `test`,
|
|
51
|
+
`reply`) are never silently replayed.
|
|
52
|
+
- **Auto-paginated** lists: `for ticket in woku.tickets.list(): ...`.
|
|
53
|
+
- **Typed errors** with the server `request_id` for support.
|
|
54
|
+
|
|
55
|
+
> **Server-only.** The secret key grants full management access. Keep it on your
|
|
56
|
+
> backend, never in a browser, mobile app or other client you do not control.
|
|
57
|
+
|
|
58
|
+
## Install
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install woku
|
|
62
|
+
# or: uv add woku
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Requires Python 3.9+.
|
|
66
|
+
|
|
67
|
+
## Quickstart
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from woku import Woku
|
|
71
|
+
|
|
72
|
+
woku = Woku(api_key="sk_...") # or set WOKU_API_KEY and call Woku()
|
|
73
|
+
|
|
74
|
+
# Create a tracker definition (idempotent).
|
|
75
|
+
tracker = woku.trackers.create({"name": "Store #1", "system": "retail"})
|
|
76
|
+
|
|
77
|
+
# Create an NPS tool and send it.
|
|
78
|
+
tool = woku.nps_tools.create(
|
|
79
|
+
{"name": "Post-purchase", "npsMessage": "How likely are you to recommend us?"}
|
|
80
|
+
)
|
|
81
|
+
woku.nps.send_invitations(
|
|
82
|
+
{"channel": "email", "npsToolId": tool["_id"], "recipients": ["ana@example.com"]}
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
# Read delivery + response rate.
|
|
86
|
+
stats = woku.dispatches.stats({"channel": "email"})
|
|
87
|
+
print(stats["responseRate"])
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The key is read from `WOKU_API_KEY` when you omit `api_key`. You can also pass
|
|
91
|
+
it directly: `Woku("sk_...")`.
|
|
92
|
+
|
|
93
|
+
Request bodies accept either a plain dict (as above) or a generated Pydantic
|
|
94
|
+
model from `woku._generated.models`.
|
|
95
|
+
|
|
96
|
+
## Async
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import asyncio
|
|
100
|
+
from woku import AsyncWoku
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
async def main() -> None:
|
|
104
|
+
async with AsyncWoku(api_key="sk_...") as woku:
|
|
105
|
+
async for ticket in await woku.tickets.list({"severity": "high"}):
|
|
106
|
+
print(ticket["title"])
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
asyncio.run(main())
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Pagination
|
|
113
|
+
|
|
114
|
+
List methods return a page you can iterate item by item across pages, or walk
|
|
115
|
+
page by page:
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
for ticket in woku.tickets.list({"severity": "high"}):
|
|
119
|
+
print(ticket["title"])
|
|
120
|
+
|
|
121
|
+
first = woku.dispatches.list({"channel": "whatsapp"})
|
|
122
|
+
if first.has_next_page():
|
|
123
|
+
second = first.get_next_page()
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Errors
|
|
127
|
+
|
|
128
|
+
Every failure is a `WokuError`. HTTP errors are typed subclasses carrying the
|
|
129
|
+
status, parsed body and `request_id`:
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from woku import NotFoundError, RateLimitError
|
|
133
|
+
|
|
134
|
+
try:
|
|
135
|
+
woku.tickets.get("nonexistent")
|
|
136
|
+
except NotFoundError as err:
|
|
137
|
+
print(err.status, err.request_id) # 404, "req_..."
|
|
138
|
+
except RateLimitError as err:
|
|
139
|
+
print("retry after", err.retry_after_seconds)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Transport failures (DNS/TLS/timeout) are `WokuConnectionError` /
|
|
143
|
+
`WokuTimeoutError`.
|
|
144
|
+
|
|
145
|
+
## Configuration
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
Woku(
|
|
149
|
+
api_key="sk_...",
|
|
150
|
+
base_url="https://clientapi.woku.app", # default
|
|
151
|
+
timeout=60.0, # seconds, default
|
|
152
|
+
max_retries=2, # default
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Per-call overrides go in the `options` argument of any method:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
woku.tickets.list({"severity": "high"}, options={"timeout": 10.0, "max_retries": 0})
|
|
160
|
+
woku.nps_tools.create(body, options={"idempotency_key": "my-key"})
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Resources
|
|
164
|
+
|
|
165
|
+
`trackers`, `nps_tools` / `csat_tools` / `ces_tools`, `nps` / `csat` / `ces`,
|
|
166
|
+
`wokus`, `forms`, `flows`, `action_plans`, `action_plan_groups`, `tickets`,
|
|
167
|
+
`ticket_destinations`, `dispatches`, `reports`, `company`, `quarantines`.
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT
|
woku-0.1.0/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# woku
|
|
4
|
+
|
|
5
|
+
Official **server-side** SDK for the [Woku](https://woku.app) management API.
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/woku/)
|
|
8
|
+
[](https://pypi.org/project/woku/)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Why
|
|
14
|
+
|
|
15
|
+
Manage your entire Woku account from your backend with one typed client:
|
|
16
|
+
trackers, VoC tools (NPS/CSAT/CES), wokus, forms, flows, action plans,
|
|
17
|
+
support tickets, delivery tracking and survey sends over the public `/v1` API.
|
|
18
|
+
|
|
19
|
+
- **Sync and async** clients (`Woku` / `AsyncWoku`) on top of `httpx`.
|
|
20
|
+
- **Typed** request bodies (Pydantic v2 models generated from the OpenAPI spec)
|
|
21
|
+
and response shapes.
|
|
22
|
+
- **Automatic retries** with full-jitter backoff and `Retry-After` support.
|
|
23
|
+
- **Idempotent creates**: creates carry an auto-generated `Idempotency-Key`, so
|
|
24
|
+
a retry after a blip never creates twice. Action calls (`send`, `test`,
|
|
25
|
+
`reply`) are never silently replayed.
|
|
26
|
+
- **Auto-paginated** lists: `for ticket in woku.tickets.list(): ...`.
|
|
27
|
+
- **Typed errors** with the server `request_id` for support.
|
|
28
|
+
|
|
29
|
+
> **Server-only.** The secret key grants full management access. Keep it on your
|
|
30
|
+
> backend, never in a browser, mobile app or other client you do not control.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install woku
|
|
36
|
+
# or: uv add woku
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Requires Python 3.9+.
|
|
40
|
+
|
|
41
|
+
## Quickstart
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from woku import Woku
|
|
45
|
+
|
|
46
|
+
woku = Woku(api_key="sk_...") # or set WOKU_API_KEY and call Woku()
|
|
47
|
+
|
|
48
|
+
# Create a tracker definition (idempotent).
|
|
49
|
+
tracker = woku.trackers.create({"name": "Store #1", "system": "retail"})
|
|
50
|
+
|
|
51
|
+
# Create an NPS tool and send it.
|
|
52
|
+
tool = woku.nps_tools.create(
|
|
53
|
+
{"name": "Post-purchase", "npsMessage": "How likely are you to recommend us?"}
|
|
54
|
+
)
|
|
55
|
+
woku.nps.send_invitations(
|
|
56
|
+
{"channel": "email", "npsToolId": tool["_id"], "recipients": ["ana@example.com"]}
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
# Read delivery + response rate.
|
|
60
|
+
stats = woku.dispatches.stats({"channel": "email"})
|
|
61
|
+
print(stats["responseRate"])
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The key is read from `WOKU_API_KEY` when you omit `api_key`. You can also pass
|
|
65
|
+
it directly: `Woku("sk_...")`.
|
|
66
|
+
|
|
67
|
+
Request bodies accept either a plain dict (as above) or a generated Pydantic
|
|
68
|
+
model from `woku._generated.models`.
|
|
69
|
+
|
|
70
|
+
## Async
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import asyncio
|
|
74
|
+
from woku import AsyncWoku
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
async def main() -> None:
|
|
78
|
+
async with AsyncWoku(api_key="sk_...") as woku:
|
|
79
|
+
async for ticket in await woku.tickets.list({"severity": "high"}):
|
|
80
|
+
print(ticket["title"])
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
asyncio.run(main())
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Pagination
|
|
87
|
+
|
|
88
|
+
List methods return a page you can iterate item by item across pages, or walk
|
|
89
|
+
page by page:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
for ticket in woku.tickets.list({"severity": "high"}):
|
|
93
|
+
print(ticket["title"])
|
|
94
|
+
|
|
95
|
+
first = woku.dispatches.list({"channel": "whatsapp"})
|
|
96
|
+
if first.has_next_page():
|
|
97
|
+
second = first.get_next_page()
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Errors
|
|
101
|
+
|
|
102
|
+
Every failure is a `WokuError`. HTTP errors are typed subclasses carrying the
|
|
103
|
+
status, parsed body and `request_id`:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from woku import NotFoundError, RateLimitError
|
|
107
|
+
|
|
108
|
+
try:
|
|
109
|
+
woku.tickets.get("nonexistent")
|
|
110
|
+
except NotFoundError as err:
|
|
111
|
+
print(err.status, err.request_id) # 404, "req_..."
|
|
112
|
+
except RateLimitError as err:
|
|
113
|
+
print("retry after", err.retry_after_seconds)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Transport failures (DNS/TLS/timeout) are `WokuConnectionError` /
|
|
117
|
+
`WokuTimeoutError`.
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
Woku(
|
|
123
|
+
api_key="sk_...",
|
|
124
|
+
base_url="https://clientapi.woku.app", # default
|
|
125
|
+
timeout=60.0, # seconds, default
|
|
126
|
+
max_retries=2, # default
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Per-call overrides go in the `options` argument of any method:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
woku.tickets.list({"severity": "high"}, options={"timeout": 10.0, "max_retries": 0})
|
|
134
|
+
woku.nps_tools.create(body, options={"idempotency_key": "my-key"})
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Resources
|
|
138
|
+
|
|
139
|
+
`trackers`, `nps_tools` / `csat_tools` / `ces_tools`, `nps` / `csat` / `ces`,
|
|
140
|
+
`wokus`, `forms`, `flows`, `action_plans`, `action_plan_groups`, `tickets`,
|
|
141
|
+
`ticket_destinations`, `dispatches`, `reports`, `company`, `quarantines`.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT
|