engineering-influence-sdk 1.0.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.

Potentially problematic release.


This version of engineering-influence-sdk might be problematic. Click here for more details.

@@ -0,0 +1,9 @@
1
+ # Made with ❤️ by [Vibey](https://the-vibey-project.github.io/vibey/), Developed by [Adam Matthew Steinberger](https://vibewithadam.matthewsteinberger.com/) ([@adammatthewsteinberger](https://github.com/adammatthewsteinberger/)).
2
+ """Typed clients for the engineering-influence API."""
3
+
4
+ from engineering_influence_sdk.async_client import AsyncEngineeringInfluenceClient
5
+ from engineering_influence_sdk.client import EngineeringInfluenceClient
6
+
7
+ __version__ = "1.0.0"
8
+
9
+ __all__ = ["AsyncEngineeringInfluenceClient", "EngineeringInfluenceClient"]
@@ -0,0 +1,96 @@
1
+ # Made with ❤️ by [Vibey](https://the-vibey-project.github.io/vibey/), Developed by [Adam Matthew Steinberger](https://vibewithadam.matthewsteinberger.com/) ([@adammatthewsteinberger](https://github.com/adammatthewsteinberger/)).
2
+ """Asynchronous engineering-influence API client."""
3
+
4
+ from collections.abc import Mapping
5
+ from typing import Any, cast
6
+ from urllib.parse import quote
7
+
8
+ import httpx
9
+
10
+ from engineering_influence_sdk.interfaces.async_client_interface import (
11
+ AsyncEngineeringInfluenceClientInterface,
12
+ )
13
+
14
+
15
+ class AsyncEngineeringInfluenceClient(AsyncEngineeringInfluenceClientInterface):
16
+ """Async counterpart to the synchronous typed client."""
17
+
18
+ def __init__(self, base_url: str, api_key: str | None = None, transport: Any = None) -> None:
19
+ headers = {"Authorization": f"Bearer {api_key}"} if api_key else {}
20
+ self._client = httpx.AsyncClient(base_url=base_url, headers=headers, transport=transport)
21
+
22
+ async def start_pipeline(
23
+ self,
24
+ slug: str,
25
+ title: str,
26
+ postulates: tuple[str, ...],
27
+ stages: tuple[str, ...],
28
+ ) -> dict[str, str]:
29
+ """Create a project and enqueue its first pipeline stage asynchronously."""
30
+ response = await self._client.post(
31
+ "/v1/pipelines",
32
+ json={
33
+ "slug": slug,
34
+ "title": title,
35
+ "postulates": list(postulates),
36
+ "stages": list(stages),
37
+ },
38
+ )
39
+ response.raise_for_status()
40
+ return cast(dict[str, str], response.json())
41
+
42
+ async def create_run(self, brief: Mapping[str, Any]) -> dict[str, Any]:
43
+ """Start a book run from a brief (the brief contract v1) asynchronously; returns the new run."""
44
+ response = await self._client.post("/v1/runs", json=dict(brief))
45
+ response.raise_for_status()
46
+ return cast(dict[str, Any], response.json())
47
+
48
+ async def list_runs(self) -> list[dict[str, Any]]:
49
+ """Every saved book run, as run summaries, asynchronously."""
50
+ response = await self._client.get("/v1/runs")
51
+ response.raise_for_status()
52
+ return cast(list[dict[str, Any]], response.json())
53
+
54
+ async def resume_run(self, run_id: str) -> dict[str, Any]:
55
+ """Un-park a parked run and queue its current stage, asynchronously."""
56
+ response = await self._client.post(f"/v1/runs/{run_id}/resume")
57
+ response.raise_for_status()
58
+ return cast(dict[str, Any], response.json())
59
+
60
+ async def grant_run(self, run_id: str, micro_usd: int | None = None) -> dict[str, Any]:
61
+ """Give a run more budget and continue it, asynchronously."""
62
+ response = await self._client.post(
63
+ f"/v1/runs/{run_id}/grant", json={"micro_usd": micro_usd}
64
+ )
65
+ response.raise_for_status()
66
+ return cast(dict[str, Any], response.json())
67
+
68
+ async def deny_run(self, run_id: str) -> dict[str, Any]:
69
+ """Refuse a run's request for more budget, asynchronously."""
70
+ response = await self._client.post(f"/v1/runs/{run_id}/deny")
71
+ response.raise_for_status()
72
+ return cast(dict[str, Any], response.json())
73
+
74
+ async def cancel_run(self, run_id: str) -> dict[str, Any]:
75
+ """Stop a run for good, asynchronously."""
76
+ response = await self._client.post(f"/v1/runs/{run_id}/cancel")
77
+ response.raise_for_status()
78
+ return cast(dict[str, Any], response.json())
79
+
80
+ async def get_run(self, run_id: str) -> dict[str, Any]:
81
+ """A run's summary: its status, stage, budget and the names of the artifacts it has stored."""
82
+ response = await self._client.get(f"/v1/runs/{quote(run_id, safe='')}")
83
+ response.raise_for_status()
84
+ return cast(dict[str, Any], response.json())
85
+
86
+ async def get_artifact(self, run_id: str, name: str) -> bytes:
87
+ """The bytes of one artifact a run stored, such as ``book/my-book.pdf``."""
88
+ response = await self._client.get(
89
+ f"/v1/runs/{quote(run_id, safe='')}/artifacts/{quote(name, safe='/')}"
90
+ )
91
+ response.raise_for_status()
92
+ return response.content
93
+
94
+ async def close(self) -> None:
95
+ """Close the underlying async HTTP connection pool."""
96
+ await self._client.aclose()
@@ -0,0 +1,94 @@
1
+ # Made with ❤️ by [Vibey](https://the-vibey-project.github.io/vibey/), Developed by [Adam Matthew Steinberger](https://vibewithadam.matthewsteinberger.com/) ([@adammatthewsteinberger](https://github.com/adammatthewsteinberger/)).
2
+ """Synchronous engineering-influence API client."""
3
+
4
+ from collections.abc import Mapping
5
+ from typing import Any, cast
6
+ from urllib.parse import quote
7
+
8
+ import httpx
9
+
10
+ from engineering_influence_sdk.interfaces.client_interface import (
11
+ EngineeringInfluenceClientInterface,
12
+ )
13
+
14
+
15
+ class EngineeringInfluenceClient(EngineeringInfluenceClientInterface):
16
+ """Small typed client with a stable pipeline-start operation."""
17
+
18
+ def __init__(self, base_url: str, api_key: str | None = None, transport: Any = None) -> None:
19
+ headers = {"Authorization": f"Bearer {api_key}"} if api_key else {}
20
+ self._client = httpx.Client(base_url=base_url, headers=headers, transport=transport)
21
+
22
+ def start_pipeline(
23
+ self,
24
+ slug: str,
25
+ title: str,
26
+ postulates: tuple[str, ...],
27
+ stages: tuple[str, ...],
28
+ ) -> dict[str, str]:
29
+ """Create a project and enqueue its first pipeline stage."""
30
+ response = self._client.post(
31
+ "/v1/pipelines",
32
+ json={
33
+ "slug": slug,
34
+ "title": title,
35
+ "postulates": list(postulates),
36
+ "stages": list(stages),
37
+ },
38
+ )
39
+ response.raise_for_status()
40
+ return cast(dict[str, str], response.json())
41
+
42
+ def create_run(self, brief: Mapping[str, Any]) -> dict[str, Any]:
43
+ """Start a book run from a brief (the brief contract v1); returns the new run."""
44
+ response = self._client.post("/v1/runs", json=dict(brief))
45
+ response.raise_for_status()
46
+ return cast(dict[str, Any], response.json())
47
+
48
+ def list_runs(self) -> list[dict[str, Any]]:
49
+ """Every saved book run, as run summaries."""
50
+ response = self._client.get("/v1/runs")
51
+ response.raise_for_status()
52
+ return cast(list[dict[str, Any]], response.json())
53
+
54
+ def resume_run(self, run_id: str) -> dict[str, Any]:
55
+ """Un-park a parked run and queue its current stage."""
56
+ response = self._client.post(f"/v1/runs/{run_id}/resume")
57
+ response.raise_for_status()
58
+ return cast(dict[str, Any], response.json())
59
+
60
+ def grant_run(self, run_id: str, micro_usd: int | None = None) -> dict[str, Any]:
61
+ """Give a run more budget and continue it: the amount it asked for, or micro_usd for a parked run."""
62
+ response = self._client.post(f"/v1/runs/{run_id}/grant", json={"micro_usd": micro_usd})
63
+ response.raise_for_status()
64
+ return cast(dict[str, Any], response.json())
65
+
66
+ def deny_run(self, run_id: str) -> dict[str, Any]:
67
+ """Refuse a run's request for more budget; the run parks."""
68
+ response = self._client.post(f"/v1/runs/{run_id}/deny")
69
+ response.raise_for_status()
70
+ return cast(dict[str, Any], response.json())
71
+
72
+ def cancel_run(self, run_id: str) -> dict[str, Any]:
73
+ """Stop a run for good."""
74
+ response = self._client.post(f"/v1/runs/{run_id}/cancel")
75
+ response.raise_for_status()
76
+ return cast(dict[str, Any], response.json())
77
+
78
+ def get_run(self, run_id: str) -> dict[str, Any]:
79
+ """A run's summary: its status, stage, budget and the names of the artifacts it has stored."""
80
+ response = self._client.get(f"/v1/runs/{quote(run_id, safe='')}")
81
+ response.raise_for_status()
82
+ return cast(dict[str, Any], response.json())
83
+
84
+ def get_artifact(self, run_id: str, name: str) -> bytes:
85
+ """The bytes of one artifact a run stored, such as ``book/my-book.pdf``."""
86
+ response = self._client.get(
87
+ f"/v1/runs/{quote(run_id, safe='')}/artifacts/{quote(name, safe='/')}"
88
+ )
89
+ response.raise_for_status()
90
+ return response.content
91
+
92
+ def close(self) -> None:
93
+ """Close the underlying HTTP connection pool."""
94
+ self._client.close()
@@ -0,0 +1,2 @@
1
+ # Made with ❤️ by [Vibey](https://the-vibey-project.github.io/vibey/), Developed by [Adam Matthew Steinberger](https://vibewithadam.matthewsteinberger.com/) ([@adammatthewsteinberger](https://github.com/adammatthewsteinberger/)).
2
+ """Interfaces of the engineering-influence clients."""
@@ -0,0 +1,58 @@
1
+ # Made with ❤️ by [Vibey](https://the-vibey-project.github.io/vibey/), Developed by [Adam Matthew Steinberger](https://vibewithadam.matthewsteinberger.com/) ([@adammatthewsteinberger](https://github.com/adammatthewsteinberger/)).
2
+ """Interface of the asynchronous engineering-influence client."""
3
+
4
+ from abc import ABC, abstractmethod
5
+ from collections.abc import Mapping
6
+ from typing import Any
7
+
8
+
9
+ class AsyncEngineeringInfluenceClientInterface(ABC):
10
+ """Async counterpart to the synchronous typed client."""
11
+
12
+ __slots__ = ()
13
+
14
+ @abstractmethod
15
+ async def create_run(self, brief: Mapping[str, Any]) -> dict[str, Any]:
16
+ """Start a book run from a brief (the brief contract v1) asynchronously."""
17
+
18
+ @abstractmethod
19
+ async def list_runs(self) -> list[dict[str, Any]]:
20
+ """Every saved book run, as run summaries, asynchronously."""
21
+
22
+ @abstractmethod
23
+ async def resume_run(self, run_id: str) -> dict[str, Any]:
24
+ """Un-park a parked run and queue its current stage, asynchronously."""
25
+
26
+ @abstractmethod
27
+ async def grant_run(self, run_id: str, micro_usd: int | None = None) -> dict[str, Any]:
28
+ """Give a run more budget and continue it, asynchronously."""
29
+
30
+ @abstractmethod
31
+ async def deny_run(self, run_id: str) -> dict[str, Any]:
32
+ """Refuse a run's request for more budget, asynchronously."""
33
+
34
+ @abstractmethod
35
+ async def cancel_run(self, run_id: str) -> dict[str, Any]:
36
+ """Stop a run for good, asynchronously."""
37
+
38
+ @abstractmethod
39
+ async def start_pipeline(
40
+ self,
41
+ slug: str,
42
+ title: str,
43
+ postulates: tuple[str, ...],
44
+ stages: tuple[str, ...],
45
+ ) -> dict[str, str]:
46
+ """Create a project and enqueue its first pipeline stage asynchronously."""
47
+
48
+ @abstractmethod
49
+ async def get_run(self, run_id: str) -> dict[str, Any]:
50
+ """A run's summary: its status, stage, budget and the names of the artifacts it has stored."""
51
+
52
+ @abstractmethod
53
+ async def get_artifact(self, run_id: str, name: str) -> bytes:
54
+ """The bytes of one artifact a run stored, such as ``book/my-book.pdf``."""
55
+
56
+ @abstractmethod
57
+ async def close(self) -> None:
58
+ """Close the underlying async HTTP connection pool."""
@@ -0,0 +1,58 @@
1
+ # Made with ❤️ by [Vibey](https://the-vibey-project.github.io/vibey/), Developed by [Adam Matthew Steinberger](https://vibewithadam.matthewsteinberger.com/) ([@adammatthewsteinberger](https://github.com/adammatthewsteinberger/)).
2
+ """Interface of the synchronous engineering-influence client."""
3
+
4
+ from abc import ABC, abstractmethod
5
+ from collections.abc import Mapping
6
+ from typing import Any
7
+
8
+
9
+ class EngineeringInfluenceClientInterface(ABC):
10
+ """Small typed client with a stable pipeline-start operation."""
11
+
12
+ __slots__ = ()
13
+
14
+ @abstractmethod
15
+ def start_pipeline(
16
+ self,
17
+ slug: str,
18
+ title: str,
19
+ postulates: tuple[str, ...],
20
+ stages: tuple[str, ...],
21
+ ) -> dict[str, str]:
22
+ """Create a project and enqueue its first pipeline stage."""
23
+
24
+ @abstractmethod
25
+ def create_run(self, brief: Mapping[str, Any]) -> dict[str, Any]:
26
+ """Start a book run from a brief (the brief contract v1); returns the new run."""
27
+
28
+ @abstractmethod
29
+ def list_runs(self) -> list[dict[str, Any]]:
30
+ """Every saved book run, as run summaries."""
31
+
32
+ @abstractmethod
33
+ def resume_run(self, run_id: str) -> dict[str, Any]:
34
+ """Un-park a parked run and queue its current stage."""
35
+
36
+ @abstractmethod
37
+ def grant_run(self, run_id: str, micro_usd: int | None = None) -> dict[str, Any]:
38
+ """Give a run more budget and continue it."""
39
+
40
+ @abstractmethod
41
+ def deny_run(self, run_id: str) -> dict[str, Any]:
42
+ """Refuse a run's request for more budget; it parks."""
43
+
44
+ @abstractmethod
45
+ def cancel_run(self, run_id: str) -> dict[str, Any]:
46
+ """Stop a run for good."""
47
+
48
+ @abstractmethod
49
+ def get_run(self, run_id: str) -> dict[str, Any]:
50
+ """A run's summary: its status, stage, budget and the names of the artifacts it has stored."""
51
+
52
+ @abstractmethod
53
+ def get_artifact(self, run_id: str, name: str) -> bytes:
54
+ """The bytes of one artifact a run stored, such as ``book/my-book.pdf``."""
55
+
56
+ @abstractmethod
57
+ def close(self) -> None:
58
+ """Close the underlying HTTP connection pool."""
File without changes
@@ -0,0 +1,42 @@
1
+ Metadata-Version: 2.5
2
+ Name: engineering-influence-sdk
3
+ Version: 1.0.0
4
+ Summary: Typed sync and async client for engineering-influence, the autonomous KDP-ready book-writing pipeline.
5
+ Project-URL: Source, https://github.com/adammatthewsteinberger/engineering-influence
6
+ Project-URL: Issues, https://github.com/adammatthewsteinberger/engineering-influence/issues
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.12
16
+ Requires-Dist: httpx<1,>=0.28
17
+ Requires-Dist: pydantic<3,>=2.10
18
+ Description-Content-Type: text/markdown
19
+
20
+ # engineering-influence-sdk
21
+
22
+ **BLUF:** A small typed Python client for the REST API of a running engineering-influence stack: start a book
23
+ run, watch it, answer its request for more budget, and download what it made. Sync and async, same methods.
24
+ To write one book on your own machine you do not need this; use the `ei book create` command.
25
+
26
+ A small typed Python client for the REST API of
27
+ [engineering-influence](https://github.com/adammatthewsteinberger/engineering-influence), the
28
+ autonomous book-writing pipeline (fiction and non-fiction) that produces KDP-ready
29
+ self-publishing packages, with a synchronous and an asynchronous flavour.
30
+
31
+ ```python
32
+ from engineering_influence_sdk import EngineeringInfluenceClient
33
+
34
+ client = EngineeringInfluenceClient("https://pipeline.example.com", api_key="...")
35
+ job = client.start_pipeline("my-book", "My Book", ("Evidence first.",), ("thesis", "book"))
36
+ client.close()
37
+ ```
38
+
39
+ `AsyncEngineeringInfluenceClient` has the same methods, awaited. The key is sent as
40
+ `Authorization: Bearer <key>`.
41
+
42
+ Requires Python 3.12 or newer. Licensed under MIT.
@@ -0,0 +1,11 @@
1
+ engineering_influence_sdk/__init__.py,sha256=YM8SoBLXWyX5yV_0bsiyB6R_aW3UhMAJxVcebiyY1DM,545
2
+ engineering_influence_sdk/async_client.py,sha256=nBqls2NjDiXoIIIoGAE4ByBQdnzgdr5PrvT-wCFDMLM,4248
3
+ engineering_influence_sdk/client.py,sha256=l7OezXs0ewB65TawxmuZ6N95ig-PV3yuEDe7pWNCIgU,4041
4
+ engineering_influence_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ engineering_influence_sdk/interfaces/__init__.py,sha256=em_Yjg7dlITlkPGS-OxNyCtcWTGijrG-kGK9yaoPM4w,289
6
+ engineering_influence_sdk/interfaces/async_client_interface.py,sha256=0U398Ewl4Oe1btXmQgAJxdgvA4Tf896bC_53u3AakFc,2251
7
+ engineering_influence_sdk/interfaces/client_interface.py,sha256=ZWnnG6ltVQEyhd5JRXKarwdPsHV4zw8XThr_NVxbQP0,2108
8
+ engineering_influence_sdk-1.0.0.dist-info/METADATA,sha256=KmS82Qhf20orLcYhb8vTf4e76DaytaIZ1kLR_C3Z6hA,1897
9
+ engineering_influence_sdk-1.0.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
10
+ engineering_influence_sdk-1.0.0.dist-info/licenses/LICENSE,sha256=JVQZiOrkPb1YJApdnAfWXkruUImRpZsKB_LOnmj7Lis,1078
11
+ engineering_influence_sdk-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adam Matthew Steinberger
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 sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do so,
10
+ 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.