runtimeai-pqdata 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.
- runtimeai_pqdata-1.0.0/PKG-INFO +17 -0
- runtimeai_pqdata-1.0.0/pqdata/__init__.py +6 -0
- runtimeai_pqdata-1.0.0/pqdata/client.py +87 -0
- runtimeai_pqdata-1.0.0/pyproject.toml +27 -0
- runtimeai_pqdata-1.0.0/runtimeai_pqdata.egg-info/PKG-INFO +17 -0
- runtimeai_pqdata-1.0.0/runtimeai_pqdata.egg-info/SOURCES.txt +9 -0
- runtimeai_pqdata-1.0.0/runtimeai_pqdata.egg-info/dependency_links.txt +1 -0
- runtimeai_pqdata-1.0.0/runtimeai_pqdata.egg-info/requires.txt +1 -0
- runtimeai_pqdata-1.0.0/runtimeai_pqdata.egg-info/top_level.txt +1 -0
- runtimeai_pqdata-1.0.0/setup.cfg +4 -0
- runtimeai_pqdata-1.0.0/setup.py +19 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: runtimeai-pqdata
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: PQData Platform Python SDK — Post-Quantum Data Security
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://runtimeai.com/products/qutonomous
|
|
7
|
+
Project-URL: Documentation, https://docs.runtimeai.com/sdks/python/pqdata
|
|
8
|
+
Project-URL: Repository, https://github.com/runtimeai/pqdata-sdk-python
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Security :: Cryptography
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: requests>=2.28.0
|
|
17
|
+
Dynamic: requires-python
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""PQData Platform Python SDK client.
|
|
2
|
+
|
|
3
|
+
R3-DP-004: Python SDK with real HTTP calls via requests library.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PQDataClient:
|
|
10
|
+
"""Client for the PQData Platform APIs.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
base_url: Base URL of the PQData platform (e.g. http://localhost:8082).
|
|
14
|
+
token: JWT bearer token for authentication.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, base_url: str = "", token: str = ""):
|
|
18
|
+
import os
|
|
19
|
+
if not base_url:
|
|
20
|
+
base_url = os.environ.get("QUTONOMOUS_API_URL") or os.environ.get("PQDATA_API_URL") or "http://localhost:8082"
|
|
21
|
+
self.base_url = base_url.rstrip("/")
|
|
22
|
+
|
|
23
|
+
if not token:
|
|
24
|
+
token = os.environ.get("QUTONOMOUS_API_KEY") or os.environ.get("PQDATA_API_KEY") or ""
|
|
25
|
+
self.token = token
|
|
26
|
+
|
|
27
|
+
self._session = requests.Session()
|
|
28
|
+
if self.token:
|
|
29
|
+
self._session.headers["Authorization"] = f"Bearer {self.token}"
|
|
30
|
+
|
|
31
|
+
def _request(self, method: str, path: str, **kwargs):
|
|
32
|
+
"""Perform an HTTP request against the PQData API."""
|
|
33
|
+
url = self.base_url + path
|
|
34
|
+
resp = self._session.request(method, url, **kwargs)
|
|
35
|
+
resp.raise_for_status()
|
|
36
|
+
return resp.json()
|
|
37
|
+
|
|
38
|
+
# ── Vault ──────────────────────────────────────────────────────────────────
|
|
39
|
+
|
|
40
|
+
def store_secret(self, path: str, value: str) -> dict:
|
|
41
|
+
"""Store a secret in QuantumVault.
|
|
42
|
+
|
|
43
|
+
POST /vault/secrets
|
|
44
|
+
"""
|
|
45
|
+
return self._request("POST", "/vault/secrets", json={"path": path, "value": value})
|
|
46
|
+
|
|
47
|
+
def get_secret(self, path: str) -> dict:
|
|
48
|
+
"""Retrieve a secret from QuantumVault.
|
|
49
|
+
|
|
50
|
+
GET /vault/secrets/{path}
|
|
51
|
+
"""
|
|
52
|
+
return self._request("GET", f"/vault/secrets/{path}")
|
|
53
|
+
|
|
54
|
+
# ── Sign ───────────────────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
def sign_document(self, data: dict) -> dict:
|
|
57
|
+
"""Sign a document using the pq-sign service.
|
|
58
|
+
|
|
59
|
+
POST /api/v1/sign/document
|
|
60
|
+
"""
|
|
61
|
+
return self._request("POST", "/api/v1/sign/document", json=data)
|
|
62
|
+
|
|
63
|
+
# ── Tokenize ───────────────────────────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
def tokenize(self, value: str, format: str = "", key_ref: str = "") -> dict:
|
|
66
|
+
"""Tokenize a value using pq-tokenvault.
|
|
67
|
+
|
|
68
|
+
POST /api/v1/tokenize
|
|
69
|
+
"""
|
|
70
|
+
payload = {"value": value}
|
|
71
|
+
if format:
|
|
72
|
+
payload["format"] = format
|
|
73
|
+
if key_ref:
|
|
74
|
+
payload["key_ref"] = key_ref
|
|
75
|
+
return self._request("POST", "/api/v1/tokenize", json=payload)
|
|
76
|
+
|
|
77
|
+
def detokenize(self, token: str, format: str = "", key_ref: str = "") -> dict:
|
|
78
|
+
"""Reverse tokenization using pq-tokenvault.
|
|
79
|
+
|
|
80
|
+
POST /api/v1/detokenize
|
|
81
|
+
"""
|
|
82
|
+
payload = {"token": token}
|
|
83
|
+
if format:
|
|
84
|
+
payload["format_id"] = format
|
|
85
|
+
if key_ref:
|
|
86
|
+
payload["key_ref"] = key_ref
|
|
87
|
+
return self._request("POST", "/api/v1/detokenize", json=payload)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "runtimeai-pqdata"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "PQData Platform Python SDK — Post-Quantum Data Security"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "Apache-2.0"}
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
dependencies = ["requests>=2.28.0"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 5 - Production/Stable",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: Apache Software License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Topic :: Security :: Cryptography",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://runtimeai.com/products/qutonomous"
|
|
23
|
+
Documentation = "https://docs.runtimeai.com/sdks/python/pqdata"
|
|
24
|
+
Repository = "https://github.com/runtimeai/pqdata-sdk-python"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.packages.find]
|
|
27
|
+
include = ["pqdata*"]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: runtimeai-pqdata
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: PQData Platform Python SDK — Post-Quantum Data Security
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://runtimeai.com/products/qutonomous
|
|
7
|
+
Project-URL: Documentation, https://docs.runtimeai.com/sdks/python/pqdata
|
|
8
|
+
Project-URL: Repository, https://github.com/runtimeai/pqdata-sdk-python
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Security :: Cryptography
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: requests>=2.28.0
|
|
17
|
+
Dynamic: requires-python
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
pyproject.toml
|
|
2
|
+
setup.py
|
|
3
|
+
pqdata/__init__.py
|
|
4
|
+
pqdata/client.py
|
|
5
|
+
runtimeai_pqdata.egg-info/PKG-INFO
|
|
6
|
+
runtimeai_pqdata.egg-info/SOURCES.txt
|
|
7
|
+
runtimeai_pqdata.egg-info/dependency_links.txt
|
|
8
|
+
runtimeai_pqdata.egg-info/requires.txt
|
|
9
|
+
runtimeai_pqdata.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests>=2.28.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pqdata
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Setup for pqdata Python SDK."""
|
|
2
|
+
|
|
3
|
+
from setuptools import setup, find_packages
|
|
4
|
+
|
|
5
|
+
setup(
|
|
6
|
+
name="pqdata",
|
|
7
|
+
version="1.0.0",
|
|
8
|
+
description="PQData Platform Python SDK — Post-Quantum Data Security",
|
|
9
|
+
packages=find_packages(),
|
|
10
|
+
python_requires=">=3.8",
|
|
11
|
+
install_requires=[
|
|
12
|
+
"requests>=2.28.0",
|
|
13
|
+
],
|
|
14
|
+
classifiers=[
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: Apache Software License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
],
|
|
19
|
+
)
|