neurionocta 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NeurionOcta
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,78 @@
1
+ Metadata-Version: 2.4
2
+ Name: neurionocta
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for NeurionOcta — AI Agent Identity, Policy and Audit Platform
5
+ Home-page: https://github.com/MorpheusBiH/neurionid
6
+ Author: NeurionOcta
7
+ Author-email: dev@neurionocta.com
8
+ License: MIT
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: requests>=2.31.0
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: home-page
28
+ Dynamic: license
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # NeurionOcta Python SDK
35
+
36
+ Official Python client for the [NeurionOcta](https://neurionocta.com) AI Agent Identity, Policy and Audit Platform.
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ pip install neurionocta
42
+ ```
43
+
44
+ ## Quick start
45
+
46
+ ```python
47
+ from neurionocta import NeurionOctaClient
48
+
49
+ client = NeurionOctaClient(api_key="nid_your_key_here")
50
+ agent = client.register_agent("your_org_id", "My Agent", ["read:data"])
51
+ print(agent["did"])
52
+ ```
53
+
54
+ ## Documentation
55
+
56
+ Full guides, SDK reference, and API docs: [docs.neurionocta.com](https://docs.neurionocta.com)
57
+
58
+ ## Error handling
59
+
60
+ Non-2xx responses raise `NeurionOctaAPIError` with `status_code` and `message`:
61
+
62
+ ```python
63
+ from neurionocta import NeurionOctaAPIError
64
+
65
+ try:
66
+ client.check_policy("did:neurion:...", "execute:api")
67
+ except NeurionOctaAPIError as e:
68
+ print(e.status_code, e.message)
69
+ ```
70
+
71
+ ## API methods
72
+
73
+ | Method | Endpoint |
74
+ |--------|----------|
75
+ | `register_agent()` | `POST /v1/agents` |
76
+ | `verify_credential()` | `GET /v1/credentials/:did` + `POST /v1/credentials/verify` |
77
+ | `check_policy()` | `POST /v1/policy/evaluate` |
78
+ | `log_action()` | `POST /v1/audit/events` |
@@ -0,0 +1,45 @@
1
+ # NeurionOcta Python SDK
2
+
3
+ Official Python client for the [NeurionOcta](https://neurionocta.com) AI Agent Identity, Policy and Audit Platform.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install neurionocta
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```python
14
+ from neurionocta import NeurionOctaClient
15
+
16
+ client = NeurionOctaClient(api_key="nid_your_key_here")
17
+ agent = client.register_agent("your_org_id", "My Agent", ["read:data"])
18
+ print(agent["did"])
19
+ ```
20
+
21
+ ## Documentation
22
+
23
+ Full guides, SDK reference, and API docs: [docs.neurionocta.com](https://docs.neurionocta.com)
24
+
25
+ ## Error handling
26
+
27
+ Non-2xx responses raise `NeurionOctaAPIError` with `status_code` and `message`:
28
+
29
+ ```python
30
+ from neurionocta import NeurionOctaAPIError
31
+
32
+ try:
33
+ client.check_policy("did:neurion:...", "execute:api")
34
+ except NeurionOctaAPIError as e:
35
+ print(e.status_code, e.message)
36
+ ```
37
+
38
+ ## API methods
39
+
40
+ | Method | Endpoint |
41
+ |--------|----------|
42
+ | `register_agent()` | `POST /v1/agents` |
43
+ | `verify_credential()` | `GET /v1/credentials/:did` + `POST /v1/credentials/verify` |
44
+ | `check_policy()` | `POST /v1/policy/evaluate` |
45
+ | `log_action()` | `POST /v1/audit/events` |
@@ -0,0 +1,7 @@
1
+ """NeurionOcta Python SDK."""
2
+
3
+ from neurionocta.client import NeurionOctaClient
4
+ from neurionocta.exceptions import NeurionOctaAPIError
5
+
6
+ __all__ = ["NeurionOctaClient", "NeurionOctaAPIError"]
7
+ __version__ = "0.1.0"
@@ -0,0 +1,135 @@
1
+ """NeurionOcta REST API client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Optional
6
+
7
+ import requests
8
+
9
+ from neurionocta.exceptions import NeurionOctaAPIError
10
+
11
+
12
+ class NeurionOctaClient:
13
+ """Python client for the NeurionOcta API."""
14
+
15
+ def __init__(
16
+ self,
17
+ api_key: str,
18
+ base_url: str = "https://neurionid-production.up.railway.app",
19
+ ) -> None:
20
+ self.api_key = api_key
21
+ self.base_url = base_url.rstrip("/")
22
+ self._session = requests.Session()
23
+ self._session.headers.update(
24
+ {
25
+ "Authorization": f"Bearer {api_key}",
26
+ "Content-Type": "application/json",
27
+ "Accept": "application/json",
28
+ }
29
+ )
30
+
31
+ def _request(
32
+ self,
33
+ method: str,
34
+ path: str,
35
+ *,
36
+ json: Optional[dict[str, Any]] = None,
37
+ ) -> Any:
38
+ url = f"{self.base_url}{path}"
39
+ response = self._session.request(method, url, json=json)
40
+
41
+ if response.ok:
42
+ if not response.content:
43
+ return {}
44
+ return response.json()
45
+
46
+ message = f"HTTP {response.status_code}"
47
+ try:
48
+ body = response.json()
49
+ if isinstance(body, dict) and "error" in body:
50
+ err = body["error"]
51
+ if isinstance(err, dict) and err.get("message"):
52
+ message = str(err["message"])
53
+ elif isinstance(body, dict) and body.get("message"):
54
+ message = str(body["message"])
55
+ except ValueError:
56
+ if response.text:
57
+ message = response.text
58
+
59
+ raise NeurionOctaAPIError(response.status_code, message)
60
+
61
+ def register_agent(
62
+ self,
63
+ organization_id: str,
64
+ agent_name: str,
65
+ permissions: list[str],
66
+ ) -> dict[str, Any]:
67
+ """
68
+ Register a new AI agent.
69
+
70
+ POST /v1/agents — returns registration data including DID and credential.
71
+ """
72
+ payload = {
73
+ "organizationId": organization_id,
74
+ "agentName": agent_name,
75
+ "permissions": permissions,
76
+ }
77
+ result = self._request("POST", "/v1/agents", json=payload)
78
+ return result.get("data", result)
79
+
80
+ def verify_credential(self, did: str) -> dict[str, Any]:
81
+ """
82
+ Verify an agent's Verifiable Credential.
83
+
84
+ Fetches the credential by DID, then POST /v1/credentials/verify.
85
+ """
86
+ fetched = self._request("GET", f"/v1/credentials/{did}")
87
+ credential = fetched.get("data", fetched).get("credential")
88
+ if not credential:
89
+ raise NeurionOctaAPIError(404, f"No credential found for agent {did}")
90
+
91
+ result = self._request(
92
+ "POST",
93
+ "/v1/credentials/verify",
94
+ json={"credential": credential},
95
+ )
96
+ return result.get("data", result)
97
+
98
+ def check_policy(
99
+ self,
100
+ agent_did: str,
101
+ action: str,
102
+ context: Optional[dict[str, Any]] = None,
103
+ ) -> dict[str, Any]:
104
+ """
105
+ Evaluate whether an agent is allowed to perform an action.
106
+
107
+ POST /v1/policy/evaluate — returns {allowed, reason, ...}.
108
+ """
109
+ payload: dict[str, Any] = {
110
+ "agentDid": agent_did,
111
+ "action": action,
112
+ "context": context or {},
113
+ }
114
+ return self._request("POST", "/v1/policy/evaluate", json=payload)
115
+
116
+ def log_action(
117
+ self,
118
+ agent_did: str,
119
+ action: str,
120
+ details: Optional[dict[str, Any]] = None,
121
+ ) -> dict[str, Any]:
122
+ """
123
+ Record an audit event for an agent action.
124
+
125
+ POST /v1/audit/events
126
+ """
127
+ payload = {
128
+ "agentDid": agent_did,
129
+ "eventType": "action.executed",
130
+ "action": action,
131
+ "context": details or {},
132
+ "result": "success",
133
+ }
134
+ result = self._request("POST", "/v1/audit/events", json=payload)
135
+ return result.get("data", result)
@@ -0,0 +1,10 @@
1
+ """NeurionOcta SDK exceptions."""
2
+
3
+
4
+ class NeurionOctaAPIError(Exception):
5
+ """Raised when the NeurionOcta API returns a non-2xx response."""
6
+
7
+ def __init__(self, status_code: int, message: str) -> None:
8
+ self.status_code = status_code
9
+ self.message = message
10
+ super().__init__(f"[{status_code}] {message}")
@@ -0,0 +1,78 @@
1
+ Metadata-Version: 2.4
2
+ Name: neurionocta
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for NeurionOcta — AI Agent Identity, Policy and Audit Platform
5
+ Home-page: https://github.com/MorpheusBiH/neurionid
6
+ Author: NeurionOcta
7
+ Author-email: dev@neurionocta.com
8
+ License: MIT
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: requests>=2.31.0
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: home-page
28
+ Dynamic: license
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # NeurionOcta Python SDK
35
+
36
+ Official Python client for the [NeurionOcta](https://neurionocta.com) AI Agent Identity, Policy and Audit Platform.
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ pip install neurionocta
42
+ ```
43
+
44
+ ## Quick start
45
+
46
+ ```python
47
+ from neurionocta import NeurionOctaClient
48
+
49
+ client = NeurionOctaClient(api_key="nid_your_key_here")
50
+ agent = client.register_agent("your_org_id", "My Agent", ["read:data"])
51
+ print(agent["did"])
52
+ ```
53
+
54
+ ## Documentation
55
+
56
+ Full guides, SDK reference, and API docs: [docs.neurionocta.com](https://docs.neurionocta.com)
57
+
58
+ ## Error handling
59
+
60
+ Non-2xx responses raise `NeurionOctaAPIError` with `status_code` and `message`:
61
+
62
+ ```python
63
+ from neurionocta import NeurionOctaAPIError
64
+
65
+ try:
66
+ client.check_policy("did:neurion:...", "execute:api")
67
+ except NeurionOctaAPIError as e:
68
+ print(e.status_code, e.message)
69
+ ```
70
+
71
+ ## API methods
72
+
73
+ | Method | Endpoint |
74
+ |--------|----------|
75
+ | `register_agent()` | `POST /v1/agents` |
76
+ | `verify_credential()` | `GET /v1/credentials/:did` + `POST /v1/credentials/verify` |
77
+ | `check_policy()` | `POST /v1/policy/evaluate` |
78
+ | `log_action()` | `POST /v1/audit/events` |
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ neurionocta/__init__.py
6
+ neurionocta/client.py
7
+ neurionocta/exceptions.py
8
+ neurionocta.egg-info/PKG-INFO
9
+ neurionocta.egg-info/SOURCES.txt
10
+ neurionocta.egg-info/dependency_links.txt
11
+ neurionocta.egg-info/requires.txt
12
+ neurionocta.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests>=2.31.0
@@ -0,0 +1 @@
1
+ neurionocta
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,32 @@
1
+ from pathlib import Path
2
+
3
+ from setuptools import find_packages, setup
4
+
5
+ ROOT = Path(__file__).parent
6
+ README = (ROOT / "README.md").read_text(encoding="utf-8")
7
+
8
+ setup(
9
+ name="neurionocta",
10
+ version="0.1.0",
11
+ description="Official Python SDK for NeurionOcta — AI Agent Identity, Policy and Audit Platform",
12
+ long_description=README,
13
+ long_description_content_type="text/markdown",
14
+ author="NeurionOcta",
15
+ author_email="dev@neurionocta.com",
16
+ url="https://github.com/MorpheusBiH/neurionid",
17
+ license="MIT",
18
+ packages=find_packages(exclude=["examples", "build"]),
19
+ python_requires=">=3.8",
20
+ install_requires=["requests>=2.31.0"],
21
+ classifiers=[
22
+ "Development Status :: 3 - Alpha",
23
+ "Intended Audience :: Developers",
24
+ "License :: OSI Approved :: MIT License",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.8",
27
+ "Programming Language :: Python :: 3.9",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ ],
32
+ )