runtimeai-pqdata 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.
pqdata/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ """PQData Platform Python SDK."""
2
+
3
+ from .client import PQDataClient
4
+
5
+ __all__ = ["PQDataClient"]
6
+ __version__ = "1.0.0"
pqdata/client.py ADDED
@@ -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,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,6 @@
1
+ pqdata/__init__.py,sha256=f9GrZpvGWj5fBABe-5uPV72YLYD1RV9L8s1fUn60vPk,118
2
+ pqdata/client.py,sha256=tFH3_47eeznB0yqnAX6iLy3VAtnvCt5axD62qJqeJDY,3326
3
+ runtimeai_pqdata-1.0.0.dist-info/METADATA,sha256=sL4VO2VMQkT-IC63LCgqPT5duA41n5-eRVyOmoaBS2Q,738
4
+ runtimeai_pqdata-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
5
+ runtimeai_pqdata-1.0.0.dist-info/top_level.txt,sha256=URgjny6ial0sG0IOFbGhhLsW2U1MzpcQJ55OrKP-9m0,7
6
+ runtimeai_pqdata-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ pqdata