owlvigil 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 (36) hide show
  1. owlvigil-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +10 -0
  2. owlvigil-0.2.0/.gitignore +9 -0
  3. owlvigil-0.2.0/CHANGELOG.md +27 -0
  4. owlvigil-0.2.0/CODE_OF_CONDUCT.md +12 -0
  5. owlvigil-0.2.0/CONTRIBUTING.md +20 -0
  6. owlvigil-0.2.0/LICENSE +21 -0
  7. owlvigil-0.2.0/PKG-INFO +111 -0
  8. owlvigil-0.2.0/README.md +77 -0
  9. owlvigil-0.2.0/SECURITY.md +21 -0
  10. owlvigil-0.2.0/SUPPORT.md +12 -0
  11. owlvigil-0.2.0/contracts/management-contract.json +582 -0
  12. owlvigil-0.2.0/contracts/management-schemas.json +5459 -0
  13. owlvigil-0.2.0/docs/DEVELOPER_GUIDE.en-US.md +361 -0
  14. owlvigil-0.2.0/docs/DEVELOPER_GUIDE.zh-CN.md +338 -0
  15. owlvigil-0.2.0/docs/RELEASING.md +16 -0
  16. owlvigil-0.2.0/pyproject.toml +53 -0
  17. owlvigil-0.2.0/scripts/generate_all.py +10 -0
  18. owlvigil-0.2.0/scripts/generate_management.py +81 -0
  19. owlvigil-0.2.0/scripts/generate_types.py +79 -0
  20. owlvigil-0.2.0/src/owlvigil/__init__.py +32 -0
  21. owlvigil-0.2.0/src/owlvigil/_core.py +356 -0
  22. owlvigil-0.2.0/src/owlvigil/_version.py +1 -0
  23. owlvigil-0.2.0/src/owlvigil/client.py +278 -0
  24. owlvigil-0.2.0/src/owlvigil/management_methods.py +874 -0
  25. owlvigil-0.2.0/src/owlvigil/management_operations.py +306 -0
  26. owlvigil-0.2.0/src/owlvigil/management_types.py +1481 -0
  27. owlvigil-0.2.0/src/owlvigil/oauth.py +152 -0
  28. owlvigil-0.2.0/src/owlvigil/py.typed +1 -0
  29. owlvigil-0.2.0/src/owlvigil/webhook.py +38 -0
  30. owlvigil-0.2.0/tests/test_client.py +77 -0
  31. owlvigil-0.2.0/tests/test_gateway.py +167 -0
  32. owlvigil-0.2.0/tests/test_live.py +16 -0
  33. owlvigil-0.2.0/tests/test_management.py +199 -0
  34. owlvigil-0.2.0/tests/test_oauth.py +68 -0
  35. owlvigil-0.2.0/tests/test_transport.py +451 -0
  36. owlvigil-0.2.0/tests/test_webhook.py +83 -0
@@ -0,0 +1,10 @@
1
+ ## Summary
2
+
3
+ ## API or behavior affected
4
+
5
+ ## Verification
6
+
7
+ - [ ] Tests added or updated
8
+ - [ ] Full local test suite passes
9
+ - [ ] Documentation updated
10
+ - [ ] No credentials or sensitive data included
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .env
9
+ .idea/
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
4
+ and uses [Semantic Versioning](https://semver.org/). During the 0.x preview,
5
+ minor releases may include announced breaking changes.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0] - 2026-09-12
10
+
11
+ ### Added
12
+
13
+ - A generated, checked-in Management OpenAPI catalog with 144 operations and
14
+ generated snake_case sync/async methods.
15
+ - Generated Python `TypedDict` definitions for 167 Management schemas.
16
+ - Management `open_api()` requests with typed path/query/body forwarding and
17
+ cursor-based workspace iteration.
18
+ - Sync and async OAuth 2.0 clients with custom base paths and consistent
19
+ protocol errors.
20
+ - Production, staging, and local environment routing compatible with the Go
21
+ SDK.
22
+
23
+ ### Changed
24
+
25
+ - Direct `pytest` execution now works with the src-layout package.
26
+ - CI validates the source package, wheel/sdist metadata, and generated API
27
+ surface.
@@ -0,0 +1,12 @@
1
+ # Code of Conduct
2
+
3
+ We are committed to a welcoming, harassment-free community. Be respectful,
4
+ assume good intent, give actionable feedback, and avoid discriminatory,
5
+ threatening, sexualized, or personally abusive conduct.
6
+
7
+ Maintainers may edit or remove inappropriate contributions and may temporarily
8
+ or permanently restrict participation. Report conduct concerns privately
9
+ through [the maintainers](https://github.com/Syrovex/owlvigil_sdk_python/security/advisories/new).
10
+ Enforcement will be fair, proportionate, and respectful of reporter privacy.
11
+
12
+ This policy is based on the principles of the Contributor Covenant 2.1.
@@ -0,0 +1,20 @@
1
+ # Contributing to OwlVigil
2
+
3
+ Thank you for improving the OwlVigil SDK.
4
+
5
+ ## Development
6
+
7
+ Use Python 3.9 or later in a virtual environment.
8
+
9
+ ```bash
10
+ python -m pip install -e '.[test]'
11
+ pytest
12
+ ```
13
+
14
+ Keep changes focused, add contract tests for public behavior, and never add API
15
+ keys, access tokens, provider credentials, or webhook secrets to commits.
16
+
17
+ Open an issue before making a large API or compatibility change. Pull requests
18
+ should explain the affected API contract, tests run, compatibility impact, and
19
+ any credential requirements. By contributing, you agree that your contribution
20
+ is licensed under this repository's MIT License.
owlvigil-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OwlVigil
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.
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: owlvigil
3
+ Version: 0.2.0
4
+ Summary: Python SDK for OwlVigil Gateway and Management APIs
5
+ Project-URL: Homepage, https://github.com/Syrovex/owlvigil_sdk_python
6
+ Project-URL: Repository, https://github.com/Syrovex/owlvigil_sdk_python
7
+ Project-URL: Issues, https://github.com/Syrovex/owlvigil_sdk_python/issues
8
+ Project-URL: Changelog, https://github.com/Syrovex/owlvigil_sdk_python/blob/main/CHANGELOG.md
9
+ Project-URL: Documentation, https://github.com/Syrovex/owlvigil_sdk_python#readme
10
+ Author: OwlVigil
11
+ Maintainer: OwlVigil
12
+ License-Expression: MIT
13
+ License-File: LICENSE
14
+ Keywords: ai,gateway,openai,owlvigil,sdk
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.9
26
+ Requires-Dist: httpx<1,>=0.27
27
+ Provides-Extra: release
28
+ Requires-Dist: build<2,>=1.2; extra == 'release'
29
+ Requires-Dist: twine<7,>=5; extra == 'release'
30
+ Provides-Extra: test
31
+ Requires-Dist: pytest-asyncio<1,>=0.24; extra == 'test'
32
+ Requires-Dist: pytest<9,>=8; extra == 'test'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # OwlVigil Python SDK
36
+
37
+ Sync and native async Python 3.9+ clients for the OwlVigil AI Gateway,
38
+ Management API, streaming, and webhook verification.
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ pip install owlvigil
44
+ ```
45
+
46
+ Until the package is published on PyPI, install a trusted source checkout
47
+ with `pip install .`.
48
+
49
+ ## Quick start
50
+
51
+ Set `OWLVIGIL_GATEWAY_KEY` and use a provider-facing model name:
52
+
53
+ ```python
54
+ from owlvigil import OwlVigil
55
+
56
+ with OwlVigil() as client:
57
+ response = client.gateway.create_chat_completion({
58
+ "model": "deepseek-v4-flash",
59
+ "messages": [{"role": "user", "content": "Hello"}],
60
+ })
61
+ print(response.data["choices"][0]["message"]["content"])
62
+ ```
63
+
64
+ `AsyncOwlVigil` provides native async requests and async streaming. Sync and
65
+ async clients are context managers and close only HTTP clients they own.
66
+
67
+ Set `OWLVIGIL_API_KEY` only for Management calls. List workspaces first, then
68
+ pass the returned workspace ID to workspace-scoped methods. `RequestOptions`
69
+ controls timeout, retry limits, idempotency keys, and safe custom headers.
70
+ Retries apply only to idempotent calls or calls with an idempotency key.
71
+
72
+ Use `environment="staging"` or `environment="local"` for the same endpoint
73
+ routing convention as the Go SDK. `OWLVIGIL_ENV` is used when the option is
74
+ omitted. Explicit base URLs remain available for reverse proxies and test
75
+ servers.
76
+
77
+ ## Supported preview surface
78
+
79
+ - Gateway models, Chat Completions, Responses, Embeddings, and Anthropic Messages
80
+ - Sync and async SSE streaming for Chat Completions and Responses
81
+ - Workspace listing, usage summary, and request-log lookup
82
+ - The complete generated 144-operation Management OpenAPI catalog, available
83
+ through `open_api()` and generated snake_case methods
84
+ - OAuth 2.0 authorization-code, refresh-token, client-credentials, revocation,
85
+ and user-info flows
86
+ - Webhook HMAC signing and verification
87
+
88
+ ## Development
89
+
90
+ ```bash
91
+ python -m pip install -e '.[test,release]'
92
+ pytest
93
+ python -m build
94
+ python -m twine check dist/*
95
+ ```
96
+
97
+ Regenerate the checked-in Management catalog and Python types with:
98
+
99
+ ```bash
100
+ python scripts/generate_all.py
101
+ ```
102
+
103
+ Live tests are opt-in and read-only.
104
+
105
+ ## Documentation
106
+
107
+ - Developer guides: [English](docs/DEVELOPER_GUIDE.en-US.md) · [简体中文](docs/DEVELOPER_GUIDE.zh-CN.md)
108
+ - [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md),
109
+ [SUPPORT.md](SUPPORT.md), and [CHANGELOG.md](CHANGELOG.md)
110
+
111
+ Licensed under the [MIT License](LICENSE).
@@ -0,0 +1,77 @@
1
+ # OwlVigil Python SDK
2
+
3
+ Sync and native async Python 3.9+ clients for the OwlVigil AI Gateway,
4
+ Management API, streaming, and webhook verification.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ pip install owlvigil
10
+ ```
11
+
12
+ Until the package is published on PyPI, install a trusted source checkout
13
+ with `pip install .`.
14
+
15
+ ## Quick start
16
+
17
+ Set `OWLVIGIL_GATEWAY_KEY` and use a provider-facing model name:
18
+
19
+ ```python
20
+ from owlvigil import OwlVigil
21
+
22
+ with OwlVigil() as client:
23
+ response = client.gateway.create_chat_completion({
24
+ "model": "deepseek-v4-flash",
25
+ "messages": [{"role": "user", "content": "Hello"}],
26
+ })
27
+ print(response.data["choices"][0]["message"]["content"])
28
+ ```
29
+
30
+ `AsyncOwlVigil` provides native async requests and async streaming. Sync and
31
+ async clients are context managers and close only HTTP clients they own.
32
+
33
+ Set `OWLVIGIL_API_KEY` only for Management calls. List workspaces first, then
34
+ pass the returned workspace ID to workspace-scoped methods. `RequestOptions`
35
+ controls timeout, retry limits, idempotency keys, and safe custom headers.
36
+ Retries apply only to idempotent calls or calls with an idempotency key.
37
+
38
+ Use `environment="staging"` or `environment="local"` for the same endpoint
39
+ routing convention as the Go SDK. `OWLVIGIL_ENV` is used when the option is
40
+ omitted. Explicit base URLs remain available for reverse proxies and test
41
+ servers.
42
+
43
+ ## Supported preview surface
44
+
45
+ - Gateway models, Chat Completions, Responses, Embeddings, and Anthropic Messages
46
+ - Sync and async SSE streaming for Chat Completions and Responses
47
+ - Workspace listing, usage summary, and request-log lookup
48
+ - The complete generated 144-operation Management OpenAPI catalog, available
49
+ through `open_api()` and generated snake_case methods
50
+ - OAuth 2.0 authorization-code, refresh-token, client-credentials, revocation,
51
+ and user-info flows
52
+ - Webhook HMAC signing and verification
53
+
54
+ ## Development
55
+
56
+ ```bash
57
+ python -m pip install -e '.[test,release]'
58
+ pytest
59
+ python -m build
60
+ python -m twine check dist/*
61
+ ```
62
+
63
+ Regenerate the checked-in Management catalog and Python types with:
64
+
65
+ ```bash
66
+ python scripts/generate_all.py
67
+ ```
68
+
69
+ Live tests are opt-in and read-only.
70
+
71
+ ## Documentation
72
+
73
+ - Developer guides: [English](docs/DEVELOPER_GUIDE.en-US.md) · [简体中文](docs/DEVELOPER_GUIDE.zh-CN.md)
74
+ - [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md),
75
+ [SUPPORT.md](SUPPORT.md), and [CHANGELOG.md](CHANGELOG.md)
76
+
77
+ Licensed under the [MIT License](LICENSE).
@@ -0,0 +1,21 @@
1
+ # Security Policy
2
+
3
+ Security reports must not be filed as public issues.
4
+
5
+ ## Supported versions
6
+
7
+ | Version | Supported |
8
+ | --- | --- |
9
+ | Latest 0.x release | Yes |
10
+ | Older 0.x releases | No |
11
+
12
+ Report a vulnerability privately through [GitHub Security
13
+ Advisories](https://github.com/Syrovex/owlvigil_sdk_python/security/advisories/new). Include the affected
14
+ version, impact, reproduction steps, and any suggested mitigation. Do not
15
+ include real customer credentials or data.
16
+
17
+ Maintainers target acknowledgement within three business days and an initial
18
+ status update within seven business days. We will validate the issue,
19
+ coordinate a fix and disclosure, and credit reporters who want attribution.
20
+ Timelines may change with severity and complexity, but reporters will receive
21
+ updates while remediation is active.
@@ -0,0 +1,12 @@
1
+ # Support
2
+
3
+ - Use [GitHub Discussions](https://github.com/Syrovex/owlvigil_sdk_python/discussions) for usage questions.
4
+ - Use [GitHub Issues](https://github.com/Syrovex/owlvigil_sdk_python/issues) for reproducible SDK bugs and feature requests.
5
+ - Use the private process in [SECURITY.md](SECURITY.md) for vulnerabilities.
6
+
7
+ Include the SDK version, runtime version, minimal reproduction, status code,
8
+ and request ID. Never post API keys, provider credentials, tokens, webhook
9
+ secrets, or sensitive request and response bodies.
10
+
11
+ The SDK is currently a 0.x preview. Backward-incompatible changes will be
12
+ called out in the changelog; deprecated APIs will be retained when practical.