deutero 0.2.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.
Files changed (37) hide show
  1. deutero-0.2.0/.gitignore +20 -0
  2. deutero-0.2.0/CHANGELOG.md +79 -0
  3. deutero-0.2.0/LICENSE +21 -0
  4. deutero-0.2.0/PKG-INFO +588 -0
  5. deutero-0.2.0/README.md +548 -0
  6. deutero-0.2.0/pyproject.toml +85 -0
  7. deutero-0.2.0/src/deutero/__init__.py +258 -0
  8. deutero-0.2.0/src/deutero/_http.py +217 -0
  9. deutero-0.2.0/src/deutero/client.py +215 -0
  10. deutero-0.2.0/src/deutero/exceptions.py +140 -0
  11. deutero-0.2.0/src/deutero/models.py +1708 -0
  12. deutero-0.2.0/src/deutero/py.typed +0 -0
  13. deutero-0.2.0/src/deutero/resources/__init__.py +53 -0
  14. deutero-0.2.0/src/deutero/resources/analysis.py +178 -0
  15. deutero-0.2.0/src/deutero/resources/characteristics.py +210 -0
  16. deutero-0.2.0/src/deutero/resources/credits.py +34 -0
  17. deutero-0.2.0/src/deutero/resources/embed.py +162 -0
  18. deutero-0.2.0/src/deutero/resources/graph.py +199 -0
  19. deutero-0.2.0/src/deutero/resources/interviews.py +187 -0
  20. deutero-0.2.0/src/deutero/resources/personas.py +120 -0
  21. deutero-0.2.0/src/deutero/resources/projects.py +89 -0
  22. deutero-0.2.0/src/deutero/resources/questions.py +310 -0
  23. deutero-0.2.0/src/deutero/resources/recruitment.py +92 -0
  24. deutero-0.2.0/src/deutero/resources/screening.py +187 -0
  25. deutero-0.2.0/src/deutero/resources/simulations.py +135 -0
  26. deutero-0.2.0/src/deutero/resources/studies.py +522 -0
  27. deutero-0.2.0/src/deutero/resources/transcripts.py +165 -0
  28. deutero-0.2.0/src/deutero/resources/webhooks.py +207 -0
  29. deutero-0.2.0/src/deutero/resources/welcome.py +154 -0
  30. deutero-0.2.0/src/deutero/webhooks.py +378 -0
  31. deutero-0.2.0/tests/__init__.py +0 -0
  32. deutero-0.2.0/tests/conftest.py +52 -0
  33. deutero-0.2.0/tests/fixtures/openapi.json +1 -0
  34. deutero-0.2.0/tests/test_client.py +175 -0
  35. deutero-0.2.0/tests/test_models.py +153 -0
  36. deutero-0.2.0/tests/test_resources.py +407 -0
  37. deutero-0.2.0/tests/test_webhooks.py +200 -0
@@ -0,0 +1,20 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ .env
10
+ node_modules
11
+ yarn-error.log
12
+ .venv
13
+ .vscode
14
+ qodana
15
+ yarn.lock
16
+ augrented-web*
17
+ .idea
18
+ *.json
19
+ !docs.json
20
+ !tests/fixtures/openapi.json
@@ -0,0 +1,79 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Deutero Python SDK will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2026-09-26
9
+
10
+ The SDK now targets the Deutero Study Management API
11
+ (`https://dashboard.deutero.ai/study-api`), and every endpoint in its OpenAPI spec is covered.
12
+ This is a breaking release: the 0.1.x endpoints (`/api/v1/surveys/...`, thematic analysis,
13
+ credit estimates) are not part of that API and have been removed.
14
+
15
+ ### Added
16
+
17
+ - **Projects**: list, create, get, update.
18
+ - **Studies**: create, list per project, get, update, participation stats.
19
+ - **Welcome & consent**: get/set the welcome message; list, upsert and delete translations.
20
+ - **Screening** and **Characteristics**: settings, plus create/update/delete/reorder questions.
21
+ - **Questions**: list, create, update, delete, reorder, validate (ethics, language, redundancy).
22
+ - **Interview flow** (`client.graph`): get, set, patch, check, signals, import from questions,
23
+ activate/deactivate, describe node types; typed `FlowDocument`/`FlowNode`/`FlowEdge`/`PatchOp` models.
24
+ - **Recruitment**: participation links, short-URL slug, quota and redirect.
25
+ - **Embed**: publishable keys and install snippets.
26
+ - **Personas & simulations**: persona CRUD and AI generation; start, list, poll and delete simulation runs.
27
+ - **Interviews**: list with filters, look up by external participant id, detail, transcript,
28
+ data fetches and signals.
29
+ - **Transcripts**: bulk export and string/semantic/hybrid search.
30
+ - **Analysis**: analyzable questions, scale/options tallies, k-means clustering, optimal cluster count.
31
+ - **Webhooks**: event types, endpoint CRUD, secret rotation, delivery log.
32
+ - `client.health()`.
33
+ - **Webhook receiving** (`deutero.webhooks`): `unwrap`, `verify`, `parse_event` and `sign` for
34
+ Standard Webhooks-signed deliveries, covering both organization events and interview-flow
35
+ signals. Typed models for all seven organization event types, and `WebhookVerificationError`.
36
+ - `PermissionDeniedError` (403, a subclass of `AuthenticationError`) and `ConflictError` (409).
37
+ - `ModelTier.STANDARD`; new `NodeType`, `SearchMode` and `AnalysisCategory` enums.
38
+ - **AI drafting**: `studies.draft` (from a research brief), `studies.draft_from_site` (from a
39
+ landing page), `questions.generate` and `welcome.generate`.
40
+ - **Publication**: `studies.get_publication`, `studies.validate`, `studies.publish` (with
41
+ acknowledgement of methodological issues or a credit shortfall) and `studies.pause`;
42
+ `status` on studies and study summaries.
43
+ - **Test runs**: `test_runs` / `include_test_runs` filters on interview lists, lookups,
44
+ transcripts and search; `test_run` on interview, transcript and search-hit models;
45
+ `test_interviews` in study stats.
46
+
47
+ ### Changed
48
+
49
+ - The default base URL is now `https://dashboard.deutero.ai/study-api`.
50
+ - `ModelTier.FRONTIER` is removed; the API treats `frontier` as a deprecated alias for `premium`.
51
+ - FastAPI validation errors (a list in `detail`) are now summarised readably in the exception message.
52
+
53
+ ### Fixed
54
+
55
+ - The `X-API-Key` header is now sent when you pass your own `http_client`.
56
+ - A custom `http_client` without a `base_url` now uses the SDK's base URL.
57
+
58
+ ### Removed
59
+
60
+ - `studies.generate`, `get_participation`, `get_agent_requirements`, `get/set_model_tier`,
61
+ `questions.generate`/`get`, `personas.generate(number_of_personas=)`, `interviews.simulate`,
62
+ the thematic `analysis.*` methods, and `credits.estimate_*`, together with their models.
63
+
64
+ ## [0.1.0] - 2025-04-14
65
+
66
+ ### Added
67
+
68
+ - Initial release of the Deutero Python SDK.
69
+ - Synchronous client (`Deutero`) and asynchronous client (`AsyncDeutero`).
70
+ - **Studies**: Generate research studies (UX, sociology, customer development, polling), get participation stats, manage model tiers, get agent requirements.
71
+ - **Questions**: Generate interview questions, get/update individual question properties.
72
+ - **Personas**: Generate interviewee personas for a study.
73
+ - **Interviews**: Simulate interviews with generated personas.
74
+ - **Analysis**: Run thematic analysis (phases 1–4), cross-case analysis (phase 5), get status and results.
75
+ - **Credits**: Check balance, estimate costs for simulations, analysis, and full surveys.
76
+ - Typed models for all request/response payloads using Pydantic v2.
77
+ - Comprehensive exception hierarchy with specific classes for common HTTP errors.
78
+ - Full type annotations and `py.typed` marker for mypy/pyright.
79
+ - Context manager support (`with Deutero(...) as client:`).
deutero-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Deutero
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.