crp-comply-sdk 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,75 @@
1
+ # Licensing
2
+
3
+ Copyright © 2025 Constantinos Vidiniotis. All rights reserved.
4
+
5
+ ## Elastic License 2.0 (ELv2)
6
+
7
+ **Licensor**: Constantinos Vidiniotis / AutoCyber AI Pty Ltd
8
+ **Licensed Work**: CRP Comply
9
+
10
+ ### What This Means
11
+
12
+ - **You CAN** use, copy, distribute, and modify the code for any purpose —
13
+ including production use in your own applications.
14
+ - **You CANNOT** provide the software to third parties as a hosted or managed
15
+ service where users get access to CRP Comply features or functionality.
16
+ - **You CANNOT** remove, alter, or obscure licensing or copyright notices.
17
+ - **You CANNOT** circumvent or remove license key functionality.
18
+
19
+ ### Full License Text
20
+
21
+ Elastic License 2.0
22
+
23
+ URL: https://www.elastic.co/licensing/elastic-license
24
+
25
+ ## Acceptance
26
+
27
+ By using the Licensed Work, you agree to all of the terms and conditions
28
+ of this license.
29
+
30
+ ## Copyright Notice
31
+
32
+ Copyright © 2025 Constantinos Vidiniotis. All rights reserved.
33
+
34
+ ## License
35
+
36
+ Subject to the terms and conditions of this Agreement, Licensor hereby
37
+ grants to you a non-exclusive, royalty-free, worldwide, non-sublicensable,
38
+ non-transferable license to use, copy, distribute, make available and
39
+ prepare derivative works of the Licensed Work, in each case subject to
40
+ the limitations below.
41
+
42
+ ## Limitations
43
+
44
+ You may not provide the Licensed Work to third parties as a hosted or
45
+ managed service, where the service provides users with access to any
46
+ substantial set of the features or functionality of the Licensed Work.
47
+
48
+ You may not move, change, disable, or circumvent the license key
49
+ functionality in the Licensed Work, and you may not remove or obscure
50
+ any functionality in the Licensed Work that is protected by the license
51
+ key.
52
+
53
+ You may not alter, remove, or obscure any licensing, copyright, or other
54
+ notices of the Licensor in the Licensed Work. Any use of the Licensor's
55
+ trademarks is subject to applicable law.
56
+
57
+ ## Patents
58
+
59
+ Licensor hereby grants you a license, under any patent claims the
60
+ Licensor can license, or becomes able to license, to make, have made,
61
+ use, sell, offer for sale, import and have imported the Licensed Work,
62
+ in each case subject to the limitations and conditions in this Agreement.
63
+ This license does not cover any patent claims that you cause to be
64
+ infringed by modifications or additions to the Licensed Work.
65
+
66
+ ## Termination
67
+
68
+ If you violate any of the terms of this Agreement, your rights will
69
+ terminate automatically and will not be reinstated without the prior
70
+ written consent of the Licensor. Any such termination will not affect
71
+ any third party's rights under this Agreement.
72
+
73
+ ---
74
+
75
+ "Context Relay Protocol" is a trademark of Constantinos Vidiniotis (application pending).
@@ -0,0 +1,180 @@
1
+ Metadata-Version: 2.4
2
+ Name: crp-comply-sdk
3
+ Version: 0.1.0
4
+ Summary: Python SDK for CRP-Comply — EU AI Act & GDPR compliance automation
5
+ Author: CRP-Comply
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://crp-comply.com
8
+ Project-URL: Documentation, https://crp-comply.com/app/sdk
9
+ Project-URL: Repository, https://github.com/crp-comply/crp-comply
10
+ Keywords: compliance,eu-ai-act,gdpr,dpia,audit,llm
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
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
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: Security
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: httpx>=0.25
24
+ Dynamic: license-file
25
+
26
+ # crp-comply-sdk
27
+
28
+ [![PyPI](https://img.shields.io/pypi/v/crp-comply-sdk.svg)](https://pypi.org/project/crp-comply-sdk/)
29
+ [![Python](https://img.shields.io/pypi/pyversions/crp-comply-sdk.svg)](https://pypi.org/project/crp-comply-sdk/)
30
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
31
+
32
+ Python SDK for [CRP-Comply](https://crp-comply.com) — EU AI Act & GDPR
33
+ compliance automation. A thin, typed HTTP client covering every user-facing
34
+ endpoint of the CRP-Comply REST API.
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ pip install crp-comply-sdk
40
+ ```
41
+
42
+ ## Quick Start
43
+
44
+ ```python
45
+ from crp_comply_sdk import CRPComply
46
+
47
+ with CRPComply(api_key="crp_...") as client:
48
+ # Account
49
+ me = client.me()
50
+ usage = client.usage()
51
+
52
+ # EU AI Act Article 6 risk classification
53
+ risk = client.risk_assessment(
54
+ system_name="Hiring Assistant",
55
+ category="employment",
56
+ affects_fundamental_rights=True,
57
+ )
58
+
59
+ # GDPR Article 35 DPIA
60
+ dpia = client.dpia(
61
+ system_name="Hiring Assistant",
62
+ data_subjects=["candidates", "employees"],
63
+ makes_automated_decisions=True,
64
+ )
65
+
66
+ # Full conformity evidence pack (zip with manifest + HMAC)
67
+ pack = client.evidence_pack(system_name="Hiring Assistant", category="employment")
68
+ zip_bytes = client.download_evidence_pack(pack["pack_id"])
69
+ with open("evidence.zip", "wb") as f:
70
+ f.write(zip_bytes)
71
+ ```
72
+
73
+ ## API Surface
74
+
75
+ All methods are keyword-only. Every call is tier-gated server-side — a
76
+ `CRPComplyTierError` is raised with an `upgrade_url` when a feature isn't
77
+ available on your plan.
78
+
79
+ ### Compliance generation
80
+
81
+ | Method | Endpoint | Purpose |
82
+ |---|---|---|
83
+ | `risk_assessment(...)` | `POST /risk-assessment` | EU AI Act Article 6 |
84
+ | `compliance_report(..., markdown=False)` | `POST /compliance-report[/markdown]` | Full compliance status |
85
+ | `dpia(...)` | `POST /dpia` | GDPR Article 35 DPIA |
86
+ | `transparency(system_name=...)` | `POST /transparency` | AI Act Article 13 |
87
+ | `technical_docs(system_name=...)` | `POST /technical-docs` | AI Act Article 11 |
88
+ | `audit_session(session_file=...)` | `POST /audit` | Audit a CRP session |
89
+ | `full_report(...)` | `POST /full-report` | Markdown mega-report |
90
+
91
+ ### Evidence packs
92
+
93
+ | Method | Endpoint |
94
+ |---|---|
95
+ | `evidence_pack(...)` | `POST /evidence-pack` — build new pack |
96
+ | `list_evidence_packs()` | `GET /evidence-packs` |
97
+ | `get_evidence_pack(pack_id)` | `GET /evidence-packs/{id}` — manifest |
98
+ | `download_evidence_pack(pack_id)` | `GET /evidence-packs/{id}/download` — raw zip bytes |
99
+ | `delete_evidence_pack(pack_id)` | `DELETE /evidence-packs/{id}` |
100
+
101
+ ### Persisted reports
102
+
103
+ | Method | Endpoint |
104
+ |---|---|
105
+ | `list_reports(kind=None)` | `GET /reports?kind=...` |
106
+ | `get_report(report_id)` | `GET /reports/{id}` |
107
+ | `get_report_markdown(report_id)` | `GET /reports/{id}/markdown` — returns `str` |
108
+ | `delete_report(report_id)` | `DELETE /reports/{id}` |
109
+
110
+ ### SDK gateway (realtime checks)
111
+
112
+ | Method | Endpoint |
113
+ |---|---|
114
+ | `features()` | `GET /sdk/features` — tier feature matrix |
115
+ | `audit(prompt=..., response=...)` | `POST /sdk/audit` — PII + injection + risk |
116
+ | `classify_risk(...)` | `POST /sdk/classify` — quick AI Act bucket |
117
+
118
+ ### Account
119
+
120
+ | Method | Endpoint |
121
+ |---|---|
122
+ | `health()` | `GET /health` (unauthenticated) |
123
+ | `me()` | `GET /me` — profile + tier + provider status |
124
+ | `usage()` | `GET /usage` — monthly quota breakdown |
125
+
126
+ ## Configuration
127
+
128
+ | Option | Env var | Default |
129
+ |---|---|---|
130
+ | `api_key` | `CRP_COMPLY_API_KEY` | — (required) |
131
+ | `base_url` | `CRP_COMPLY_BASE_URL` | `https://api.crp-comply.com/api/v1` |
132
+ | `timeout` | — | 60 seconds |
133
+
134
+ ```python
135
+ import os
136
+ os.environ["CRP_COMPLY_API_KEY"] = "crp_..."
137
+ os.environ["CRP_COMPLY_BASE_URL"] = "https://api.crp-comply.com/api/v1"
138
+
139
+ from crp_comply_sdk import CRPComply
140
+ client = CRPComply() # picks up env vars
141
+ ```
142
+
143
+ ## LLM Backends
144
+
145
+ CRP-Comply is LLM-agnostic. Configure your preferred backend server-side at
146
+ [Settings → LLM Provider](https://crp-comply.com/app/setup). Supported:
147
+
148
+ | Backend | Default URL | Notes |
149
+ |---|---|---|
150
+ | OpenAI | `https://api.openai.com/v1` | Cloud |
151
+ | Anthropic | `https://api.anthropic.com/v1` | Cloud |
152
+ | LM Studio | `http://localhost:1234/v1` | Local, OpenAI-compatible |
153
+ | Ollama | `http://localhost:11434/v1` | Local, OpenAI-compatible |
154
+ | Custom | any | Any OpenAI-compatible endpoint |
155
+
156
+ ## Exception Hierarchy
157
+
158
+ ```
159
+ CRPComplyError # base — all SDK errors
160
+ ├── CRPComplyAuthError # 401, 403 — invalid / missing API key
161
+ ├── CRPComplyQuotaError # 429 — monthly quota exhausted (has .upgrade_url)
162
+ ├── CRPComplyTierError # 402 — feature not in tier (has .upgrade_url,
163
+ │ # .feature, .current_tier, .required_tier)
164
+ └── CRPComplyServerError # 5xx — server-side failure
165
+ ```
166
+
167
+ ```python
168
+ from crp_comply_sdk import CRPComply, CRPComplyTierError, CRPComplyQuotaError
169
+
170
+ try:
171
+ pack = client.evidence_pack(system_name="X", category="y")
172
+ except CRPComplyTierError as exc:
173
+ print(f"Upgrade required: {exc.upgrade_url}")
174
+ except CRPComplyQuotaError as exc:
175
+ print(f"Quota exhausted. Upgrade at {exc.upgrade_url}")
176
+ ```
177
+
178
+ ## License
179
+
180
+ Apache-2.0 — see [LICENSE](LICENSE).
@@ -0,0 +1,155 @@
1
+ # crp-comply-sdk
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/crp-comply-sdk.svg)](https://pypi.org/project/crp-comply-sdk/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/crp-comply-sdk.svg)](https://pypi.org/project/crp-comply-sdk/)
5
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
6
+
7
+ Python SDK for [CRP-Comply](https://crp-comply.com) — EU AI Act & GDPR
8
+ compliance automation. A thin, typed HTTP client covering every user-facing
9
+ endpoint of the CRP-Comply REST API.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install crp-comply-sdk
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```python
20
+ from crp_comply_sdk import CRPComply
21
+
22
+ with CRPComply(api_key="crp_...") as client:
23
+ # Account
24
+ me = client.me()
25
+ usage = client.usage()
26
+
27
+ # EU AI Act Article 6 risk classification
28
+ risk = client.risk_assessment(
29
+ system_name="Hiring Assistant",
30
+ category="employment",
31
+ affects_fundamental_rights=True,
32
+ )
33
+
34
+ # GDPR Article 35 DPIA
35
+ dpia = client.dpia(
36
+ system_name="Hiring Assistant",
37
+ data_subjects=["candidates", "employees"],
38
+ makes_automated_decisions=True,
39
+ )
40
+
41
+ # Full conformity evidence pack (zip with manifest + HMAC)
42
+ pack = client.evidence_pack(system_name="Hiring Assistant", category="employment")
43
+ zip_bytes = client.download_evidence_pack(pack["pack_id"])
44
+ with open("evidence.zip", "wb") as f:
45
+ f.write(zip_bytes)
46
+ ```
47
+
48
+ ## API Surface
49
+
50
+ All methods are keyword-only. Every call is tier-gated server-side — a
51
+ `CRPComplyTierError` is raised with an `upgrade_url` when a feature isn't
52
+ available on your plan.
53
+
54
+ ### Compliance generation
55
+
56
+ | Method | Endpoint | Purpose |
57
+ |---|---|---|
58
+ | `risk_assessment(...)` | `POST /risk-assessment` | EU AI Act Article 6 |
59
+ | `compliance_report(..., markdown=False)` | `POST /compliance-report[/markdown]` | Full compliance status |
60
+ | `dpia(...)` | `POST /dpia` | GDPR Article 35 DPIA |
61
+ | `transparency(system_name=...)` | `POST /transparency` | AI Act Article 13 |
62
+ | `technical_docs(system_name=...)` | `POST /technical-docs` | AI Act Article 11 |
63
+ | `audit_session(session_file=...)` | `POST /audit` | Audit a CRP session |
64
+ | `full_report(...)` | `POST /full-report` | Markdown mega-report |
65
+
66
+ ### Evidence packs
67
+
68
+ | Method | Endpoint |
69
+ |---|---|
70
+ | `evidence_pack(...)` | `POST /evidence-pack` — build new pack |
71
+ | `list_evidence_packs()` | `GET /evidence-packs` |
72
+ | `get_evidence_pack(pack_id)` | `GET /evidence-packs/{id}` — manifest |
73
+ | `download_evidence_pack(pack_id)` | `GET /evidence-packs/{id}/download` — raw zip bytes |
74
+ | `delete_evidence_pack(pack_id)` | `DELETE /evidence-packs/{id}` |
75
+
76
+ ### Persisted reports
77
+
78
+ | Method | Endpoint |
79
+ |---|---|
80
+ | `list_reports(kind=None)` | `GET /reports?kind=...` |
81
+ | `get_report(report_id)` | `GET /reports/{id}` |
82
+ | `get_report_markdown(report_id)` | `GET /reports/{id}/markdown` — returns `str` |
83
+ | `delete_report(report_id)` | `DELETE /reports/{id}` |
84
+
85
+ ### SDK gateway (realtime checks)
86
+
87
+ | Method | Endpoint |
88
+ |---|---|
89
+ | `features()` | `GET /sdk/features` — tier feature matrix |
90
+ | `audit(prompt=..., response=...)` | `POST /sdk/audit` — PII + injection + risk |
91
+ | `classify_risk(...)` | `POST /sdk/classify` — quick AI Act bucket |
92
+
93
+ ### Account
94
+
95
+ | Method | Endpoint |
96
+ |---|---|
97
+ | `health()` | `GET /health` (unauthenticated) |
98
+ | `me()` | `GET /me` — profile + tier + provider status |
99
+ | `usage()` | `GET /usage` — monthly quota breakdown |
100
+
101
+ ## Configuration
102
+
103
+ | Option | Env var | Default |
104
+ |---|---|---|
105
+ | `api_key` | `CRP_COMPLY_API_KEY` | — (required) |
106
+ | `base_url` | `CRP_COMPLY_BASE_URL` | `https://api.crp-comply.com/api/v1` |
107
+ | `timeout` | — | 60 seconds |
108
+
109
+ ```python
110
+ import os
111
+ os.environ["CRP_COMPLY_API_KEY"] = "crp_..."
112
+ os.environ["CRP_COMPLY_BASE_URL"] = "https://api.crp-comply.com/api/v1"
113
+
114
+ from crp_comply_sdk import CRPComply
115
+ client = CRPComply() # picks up env vars
116
+ ```
117
+
118
+ ## LLM Backends
119
+
120
+ CRP-Comply is LLM-agnostic. Configure your preferred backend server-side at
121
+ [Settings → LLM Provider](https://crp-comply.com/app/setup). Supported:
122
+
123
+ | Backend | Default URL | Notes |
124
+ |---|---|---|
125
+ | OpenAI | `https://api.openai.com/v1` | Cloud |
126
+ | Anthropic | `https://api.anthropic.com/v1` | Cloud |
127
+ | LM Studio | `http://localhost:1234/v1` | Local, OpenAI-compatible |
128
+ | Ollama | `http://localhost:11434/v1` | Local, OpenAI-compatible |
129
+ | Custom | any | Any OpenAI-compatible endpoint |
130
+
131
+ ## Exception Hierarchy
132
+
133
+ ```
134
+ CRPComplyError # base — all SDK errors
135
+ ├── CRPComplyAuthError # 401, 403 — invalid / missing API key
136
+ ├── CRPComplyQuotaError # 429 — monthly quota exhausted (has .upgrade_url)
137
+ ├── CRPComplyTierError # 402 — feature not in tier (has .upgrade_url,
138
+ │ # .feature, .current_tier, .required_tier)
139
+ └── CRPComplyServerError # 5xx — server-side failure
140
+ ```
141
+
142
+ ```python
143
+ from crp_comply_sdk import CRPComply, CRPComplyTierError, CRPComplyQuotaError
144
+
145
+ try:
146
+ pack = client.evidence_pack(system_name="X", category="y")
147
+ except CRPComplyTierError as exc:
148
+ print(f"Upgrade required: {exc.upgrade_url}")
149
+ except CRPComplyQuotaError as exc:
150
+ print(f"Quota exhausted. Upgrade at {exc.upgrade_url}")
151
+ ```
152
+
153
+ ## License
154
+
155
+ Apache-2.0 — see [LICENSE](LICENSE).
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "crp-comply-sdk"
7
+ version = "0.1.0"
8
+ description = "Python SDK for CRP-Comply — EU AI Act & GDPR compliance automation"
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE"]
12
+ authors = [
13
+ { name = "CRP-Comply" },
14
+ ]
15
+ requires-python = ">=3.9"
16
+ dependencies = [
17
+ "httpx>=0.25",
18
+ ]
19
+ keywords = ["compliance", "eu-ai-act", "gdpr", "dpia", "audit", "llm"]
20
+ classifiers = [
21
+ "Development Status :: 4 - Beta",
22
+ "Intended Audience :: Developers",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Topic :: Security",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://crp-comply.com"
34
+ Documentation = "https://crp-comply.com/app/sdk"
35
+ Repository = "https://github.com/crp-comply/crp-comply"
36
+
37
+ [tool.setuptools.packages.find]
38
+ where = ["src"]
39
+
40
+ [tool.setuptools.package-data]
41
+ crp_comply_sdk = ["py.typed"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,26 @@
1
+ """CRP-Comply Python SDK.
2
+
3
+ Thin HTTP client for the CRP-Comply REST API. The SDK itself is free;
4
+ server-side tier gating decides which features are available at call time.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from crp_comply_sdk._client import CRPComply
10
+ from crp_comply_sdk._errors import (
11
+ CRPComplyError,
12
+ CRPComplyAuthError,
13
+ CRPComplyQuotaError,
14
+ CRPComplyTierError,
15
+ CRPComplyServerError,
16
+ )
17
+
18
+ __all__ = [
19
+ "CRPComply",
20
+ "CRPComplyError",
21
+ "CRPComplyAuthError",
22
+ "CRPComplyQuotaError",
23
+ "CRPComplyTierError",
24
+ "CRPComplyServerError",
25
+ ]
26
+ __version__ = "0.1.0"