creat01deployengine 1.0.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. creat01deployengine-1.0.0/.gitignore +214 -0
  2. creat01deployengine-1.0.0/AI_USAGE.md +68 -0
  3. creat01deployengine-1.0.0/LICENSE +9 -0
  4. creat01deployengine-1.0.0/PKG-INFO +81 -0
  5. creat01deployengine-1.0.0/README.md +65 -0
  6. creat01deployengine-1.0.0/pyproject.toml +30 -0
  7. creat01deployengine-1.0.0/src/creat01deployengine/__init__.py +22 -0
  8. creat01deployengine-1.0.0/src/creat01deployengine/client.py +276 -0
  9. creat01deployengine-1.0.0/src/creat01deployengine/errors.py +51 -0
  10. creat01deployengine-1.0.0/src/creat01deployengine/logging/__init__.py +5 -0
  11. creat01deployengine-1.0.0/src/creat01deployengine/logging/reporter.py +66 -0
  12. creat01deployengine-1.0.0/src/creat01deployengine/models/__init__.py +14 -0
  13. creat01deployengine-1.0.0/src/creat01deployengine/models/common.py +16 -0
  14. creat01deployengine-1.0.0/src/creat01deployengine/models/infrastructure.py +27 -0
  15. creat01deployengine-1.0.0/src/creat01deployengine/models/projects.py +17 -0
  16. creat01deployengine-1.0.0/src/creat01deployengine/py.typed +1 -0
  17. creat01deployengine-1.0.0/src/creat01deployengine/resources/__init__.py +34 -0
  18. creat01deployengine-1.0.0/src/creat01deployengine/resources/alerts.py +13 -0
  19. creat01deployengine-1.0.0/src/creat01deployengine/resources/authentication.py +38 -0
  20. creat01deployengine-1.0.0/src/creat01deployengine/resources/base.py +44 -0
  21. creat01deployengine-1.0.0/src/creat01deployengine/resources/certificates.py +19 -0
  22. creat01deployengine-1.0.0/src/creat01deployengine/resources/domains.py +27 -0
  23. creat01deployengine-1.0.0/src/creat01deployengine/resources/feedback.py +15 -0
  24. creat01deployengine-1.0.0/src/creat01deployengine/resources/load_balancers.py +33 -0
  25. creat01deployengine-1.0.0/src/creat01deployengine/resources/machines.py +21 -0
  26. creat01deployengine-1.0.0/src/creat01deployengine/resources/payments.py +25 -0
  27. creat01deployengine-1.0.0/src/creat01deployengine/resources/projects.py +37 -0
  28. creat01deployengine-1.0.0/src/creat01deployengine/resources/security_groups.py +28 -0
  29. creat01deployengine-1.0.0/src/creat01deployengine/resources/tracking.py +37 -0
  30. creat01deployengine-1.0.0/src/creat01deployengine/resources/workflows.py +19 -0
  31. creat01deployengine-1.0.0/src/creat01deployengine/tracking/__init__.py +5 -0
  32. creat01deployengine-1.0.0/src/creat01deployengine/tracking/client.py +92 -0
  33. creat01deployengine-1.0.0/src/creat01deployengine/version.py +3 -0
  34. creat01deployengine-1.0.0/tests/test_client.py +94 -0
  35. creat01deployengine-1.0.0/tests/test_live_api.py +35 -0
  36. creat01deployengine-1.0.0/tests/test_resource_contracts.py +347 -0
  37. creat01deployengine-1.0.0/uv.lock +341 -0
@@ -0,0 +1,214 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # SageMath parsed files
124
+ *.sage.py
125
+
126
+ # Environments
127
+ .env
128
+ .venv
129
+ env/
130
+ venv/
131
+ ENV/
132
+ env.bak/
133
+ venv.bak/
134
+
135
+ # Spyder project settings
136
+ .spyderproject
137
+ .spyproject
138
+
139
+ # Rope project settings
140
+ .ropeproject
141
+
142
+ # mkdocs documentation
143
+ /site
144
+
145
+ # mypy
146
+ .mypy_cache/
147
+ .dmypy.json
148
+ dmypy.json
149
+
150
+ # Pyre type checker
151
+ .pyre/
152
+
153
+ # pytype static type analyzer
154
+ .pytype/
155
+
156
+ # Cython debug symbols
157
+ cython_debug/
158
+
159
+ # PyCharm
160
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
163
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
+ #.idea/
165
+
166
+ # Ruff stuff:
167
+ .ruff_cache/
168
+
169
+ # PyPI configuration file
170
+ .pypirc
171
+
172
+ test.py
173
+
174
+ # Logs
175
+ logs
176
+ *.log
177
+ npm-debug.log*
178
+ yarn-debug.log*
179
+ yarn-error.log*
180
+ pnpm-debug.log*
181
+ lerna-debug.log*
182
+
183
+ node_modules
184
+ dist
185
+ dist-ssr
186
+ *.local
187
+
188
+ # Editor directories and files
189
+ .vscode/*
190
+ !.vscode/extensions.json
191
+ .idea
192
+ .DS_Store
193
+ *.suo
194
+ *.ntvs*
195
+ *.njsproj
196
+ *.sln
197
+ *.sw?
198
+ package-lock.json
199
+ !client/typescript/package-lock.json
200
+
201
+ storage/
202
+ .vite/
203
+ temp*
204
+ pip_packages/
205
+ *.mp4
206
+ *.mp3
207
+ *.pem
208
+ local_settings.py
209
+ certs/
210
+ reference/
211
+ *.bak
212
+ *.dat
213
+ *.dir
214
+ .dev/
@@ -0,0 +1,68 @@
1
+ # AI usage guide — Python
2
+
3
+ Use this decision order when generating code with `creat01deployengine`.
4
+
5
+ 1. For management operations, read `DEPLOYENGINE_API_KEY` from the server
6
+ environment and create `DeployEngine` or `AsyncDeployEngine`.
7
+ 2. For browser/application telemetry, use only `Tracker` with a project
8
+ `write_key`. Never substitute a management API key.
9
+ 3. Prefer named resource methods over raw `client.request`.
10
+ 4. For writes, provide an idempotency key when the method accepts one. Never
11
+ retry a payment, deployment, DNS, or infrastructure write blindly.
12
+ 5. Catch typed errors and log `request_id`, but never log credentials.
13
+
14
+ ## Method selection
15
+
16
+ ```text
17
+ list/get/create/update/delete resource -> resource.list/get/create/update/delete
18
+ deployment validation -> projects.precheck
19
+ start deployment -> projects.deploy_stream
20
+ restart project -> projects.restart_stream
21
+ deployment/release history -> projects.deployments/releases
22
+ machine sizing -> machines.recommendations
23
+ Agent connectivity -> machines.agent_status
24
+ port connectivity -> machines.test_port
25
+ workflow state -> workflows.progress/detail
26
+ stop workflow -> workflows.terminate
27
+ upload/renew/deploy TLS -> certificates.upload/renew/deploy
28
+ DNS records -> domains.records/create_record/update_record/delete_record
29
+ sync load balancer -> load_balancers.sync
30
+ bind project to load balancer -> load_balancers.bind_project
31
+ add load-balancer listener -> load_balancers.add_listener
32
+ apply host firewall -> security_groups.apply
33
+ add firewall rule -> security_groups.add_rule
34
+ send alert -> alerts.send
35
+ create payment -> payments.create_order
36
+ refund payment -> payments.refund
37
+ send end-user login code -> authentication.send_code
38
+ login with code/password -> authentication.login_with_code/password_login
39
+ create customer feedback link -> feedback.create_ticket_link
40
+ tracking analytics/identity -> Tracker.track/identify
41
+ send application log -> LogReporter.debug/info/warning/error
42
+ ```
43
+
44
+ `DeployEngine` methods return values immediately. The same resource methods on
45
+ `AsyncDeployEngine` must be awaited. Sync streams use `for`; async streams use
46
+ `async for`.
47
+
48
+ ```python
49
+ import os
50
+ from creat01deployengine import AsyncDeployEngine
51
+ from creat01deployengine.errors import DeployEngineError
52
+
53
+ async def deploy(project_id: int, body: dict) -> None:
54
+ try:
55
+ async with AsyncDeployEngine(
56
+ api_key=os.environ["DEPLOYENGINE_API_KEY"]
57
+ ) as client:
58
+ async for event in client.projects.deploy_stream(project_id, body):
59
+ print(event)
60
+ except DeployEngineError as exc:
61
+ print(exc.status_code, exc.code, exc.request_id)
62
+ raise
63
+ ```
64
+
65
+ Scopes: `read`, `deploy`, `machines`, `databases`, `certificates`,
66
+ `monitoring`, `infrastructure`, and `business`. A 403 means the key needs the
67
+ scope documented on the resource; do not work around it with a broader key in
68
+ client code.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Creat01
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.5
2
+ Name: creat01deployengine
3
+ Version: 1.0.0
4
+ Summary: Official Python SDK for Creat01 DeployEngine
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Typing :: Typed
10
+ Requires-Python: >=3.9
11
+ Requires-Dist: httpx<1,>=0.27
12
+ Provides-Extra: test
13
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'test'
14
+ Requires-Dist: pytest>=8; extra == 'test'
15
+ Description-Content-Type: text/markdown
16
+
17
+ # creat01deployengine Python SDK
18
+
19
+ Official synchronous and asynchronous clients for the DeployEngine API.
20
+
21
+ ```bash
22
+ python -m pip install creat01deployengine
23
+ ```
24
+
25
+ Use `DeployEngine` in synchronous code, `AsyncDeployEngine` in asyncio code,
26
+ and `Tracker`/`LogReporter` for application-side event ingestion. Never ship a
27
+ management API key in browser, desktop, or mobile code.
28
+
29
+ ```python
30
+ import os
31
+ from creat01deployengine import DeployEngine
32
+ from creat01deployengine.errors import PermissionDeniedError
33
+
34
+ try:
35
+ with DeployEngine(
36
+ api_key=os.environ["DEPLOYENGINE_API_KEY"],
37
+ base_url="https://deployengine.creat01.com",
38
+ ) as client:
39
+ projects = client.projects.list(page=1, pageSize=20)
40
+ machine = client.machines.get(12)
41
+ except PermissionDeniedError as exc:
42
+ print(f"missing API scope; request={exc.request_id}")
43
+ ```
44
+
45
+ ```python
46
+ from creat01deployengine import AsyncDeployEngine
47
+
48
+ async with AsyncDeployEngine(api_key=key) as client:
49
+ projects = await client.projects.list()
50
+ ```
51
+
52
+ ## Resource map
53
+
54
+ | Attribute | Purpose | Typical scope |
55
+ |---|---|---|
56
+ | `projects` | CRUD, precheck, deployments, releases, deploy/restart streams | `read`, `deploy` |
57
+ | `machines` | CRUD, recommendations, Agent state, port checks | `machines` |
58
+ | `workflows` | Task progress, detail, termination | `read`, `deploy` |
59
+ | `certificates` | CRUD, upload, renewal, deployment | `certificates` |
60
+ | `domains` | Domain CRUD and DNS records | `read` |
61
+ | `load_balancers` | Gateway config, sync, bindings, listeners | `infrastructure` |
62
+ | `security_groups` | Host firewall policy, apply, rules | `infrastructure` |
63
+ | `alerts` | Alert contacts and notification sending | `monitoring` |
64
+ | `payments` | Payment orders and refunds | `business` |
65
+ | `authentication` | Project SMS/email/password login | `business` |
66
+ | `feedback` | Customer feedback ticket links | `business` |
67
+ | `tracking` | Low-level event ingestion | tracking write key |
68
+
69
+ ```python
70
+ with DeployEngine(api_key=key) as client:
71
+ for event in client.projects.deploy_stream(7, {"branch": "main"}):
72
+ print(event)
73
+ ```
74
+
75
+ Resources return the unwrapped `data` field. Writes are not retried unless an
76
+ idempotency key is present. `DeployEngineError` exposes `status_code`, `code`,
77
+ `request_id`, `details`, and `retryable`. See `AI_USAGE.md` for task recipes.
78
+
79
+ Maintainers can run the opt-in live smoke test with
80
+ `DEPLOYENGINE_E2E_API_KEY=... pytest tests/test_live_api.py`. It performs only
81
+ authenticated list operations and does not deploy or mutate resources.
@@ -0,0 +1,65 @@
1
+ # creat01deployengine Python SDK
2
+
3
+ Official synchronous and asynchronous clients for the DeployEngine API.
4
+
5
+ ```bash
6
+ python -m pip install creat01deployengine
7
+ ```
8
+
9
+ Use `DeployEngine` in synchronous code, `AsyncDeployEngine` in asyncio code,
10
+ and `Tracker`/`LogReporter` for application-side event ingestion. Never ship a
11
+ management API key in browser, desktop, or mobile code.
12
+
13
+ ```python
14
+ import os
15
+ from creat01deployengine import DeployEngine
16
+ from creat01deployengine.errors import PermissionDeniedError
17
+
18
+ try:
19
+ with DeployEngine(
20
+ api_key=os.environ["DEPLOYENGINE_API_KEY"],
21
+ base_url="https://deployengine.creat01.com",
22
+ ) as client:
23
+ projects = client.projects.list(page=1, pageSize=20)
24
+ machine = client.machines.get(12)
25
+ except PermissionDeniedError as exc:
26
+ print(f"missing API scope; request={exc.request_id}")
27
+ ```
28
+
29
+ ```python
30
+ from creat01deployengine import AsyncDeployEngine
31
+
32
+ async with AsyncDeployEngine(api_key=key) as client:
33
+ projects = await client.projects.list()
34
+ ```
35
+
36
+ ## Resource map
37
+
38
+ | Attribute | Purpose | Typical scope |
39
+ |---|---|---|
40
+ | `projects` | CRUD, precheck, deployments, releases, deploy/restart streams | `read`, `deploy` |
41
+ | `machines` | CRUD, recommendations, Agent state, port checks | `machines` |
42
+ | `workflows` | Task progress, detail, termination | `read`, `deploy` |
43
+ | `certificates` | CRUD, upload, renewal, deployment | `certificates` |
44
+ | `domains` | Domain CRUD and DNS records | `read` |
45
+ | `load_balancers` | Gateway config, sync, bindings, listeners | `infrastructure` |
46
+ | `security_groups` | Host firewall policy, apply, rules | `infrastructure` |
47
+ | `alerts` | Alert contacts and notification sending | `monitoring` |
48
+ | `payments` | Payment orders and refunds | `business` |
49
+ | `authentication` | Project SMS/email/password login | `business` |
50
+ | `feedback` | Customer feedback ticket links | `business` |
51
+ | `tracking` | Low-level event ingestion | tracking write key |
52
+
53
+ ```python
54
+ with DeployEngine(api_key=key) as client:
55
+ for event in client.projects.deploy_stream(7, {"branch": "main"}):
56
+ print(event)
57
+ ```
58
+
59
+ Resources return the unwrapped `data` field. Writes are not retried unless an
60
+ idempotency key is present. `DeployEngineError` exposes `status_code`, `code`,
61
+ `request_id`, `details`, and `retryable`. See `AI_USAGE.md` for task recipes.
62
+
63
+ Maintainers can run the opt-in live smoke test with
64
+ `DEPLOYENGINE_E2E_API_KEY=... pytest tests/test_live_api.py`. It performs only
65
+ authenticated list operations and does not deploy or mutate resources.
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "creat01deployengine"
7
+ version = "1.0.0"
8
+ description = "Official Python SDK for Creat01 DeployEngine"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ dependencies = ["httpx>=0.27,<1"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Programming Language :: Python :: 3",
16
+ "Typing :: Typed",
17
+ ]
18
+
19
+ [project.optional-dependencies]
20
+ test = ["pytest>=8", "pytest-asyncio>=0.24"]
21
+
22
+ [tool.hatch.build.targets.wheel]
23
+ packages = ["src/creat01deployengine"]
24
+
25
+ [tool.hatch.build.targets.wheel.force-include]
26
+ "AI_USAGE.md" = "creat01deployengine/AI_USAGE.md"
27
+
28
+ [tool.pytest.ini_options]
29
+ pythonpath = ["src"]
30
+ asyncio_mode = "auto"
@@ -0,0 +1,22 @@
1
+ """Public entry point for the Creat01 DeployEngine Python SDK.
2
+
3
+ Use :class:`DeployEngine` in synchronous applications and
4
+ :class:`AsyncDeployEngine` in asyncio services. Management clients require a
5
+ server-side API key or bearer token; browser-safe event ingestion uses
6
+ :class:`Tracker` instead.
7
+ """
8
+
9
+ from .client import AsyncDeployEngine, DeployEngine
10
+ from .errors import DeployEngineError
11
+ from .logging import LogReporter
12
+ from .tracking import Tracker
13
+ from .version import __version__
14
+
15
+ __all__ = [
16
+ "AsyncDeployEngine",
17
+ "DeployEngine",
18
+ "DeployEngineError",
19
+ "LogReporter",
20
+ "Tracker",
21
+ "__version__",
22
+ ]