protegrity-anonymization-sdk 2.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.
- anonymization_sdk/__init__.py +120 -0
- anonymization_sdk/_helpers.py +852 -0
- anonymization_sdk/client.py +1804 -0
- anonymization_sdk/exceptions.py +56 -0
- anonymization_sdk/models.py +702 -0
- anonymization_sdk/py.typed +0 -0
- protegrity_anonymization_sdk-2.0.0.dist-info/METADATA +176 -0
- protegrity_anonymization_sdk-2.0.0.dist-info/RECORD +9 -0
- protegrity_anonymization_sdk-2.0.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Anonymization SDK Interface.
|
|
3
|
+
|
|
4
|
+
Provides Python client libraries for the Anonymization REST API.
|
|
5
|
+
|
|
6
|
+
Modules:
|
|
7
|
+
models – Enums and response dataclasses
|
|
8
|
+
exceptions – Custom exception hierarchy
|
|
9
|
+
_helpers – Internal utilities, payload builders, endpoint constants
|
|
10
|
+
client – Synchronous and asynchronous HTTP clients
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
# Clients
|
|
14
|
+
# Version — read from package metadata (set in pyproject.toml)
|
|
15
|
+
from importlib.metadata import PackageNotFoundError, version as _pkg_version
|
|
16
|
+
|
|
17
|
+
# Constants
|
|
18
|
+
from anonymization_sdk._helpers import DEFAULT_BASE_URL, DEFAULT_TIMEOUT
|
|
19
|
+
from anonymization_sdk.client import AnonymizationClient, AsyncAnonymizationClient
|
|
20
|
+
|
|
21
|
+
# Exceptions
|
|
22
|
+
from anonymization_sdk.exceptions import (
|
|
23
|
+
AnonymizationClientError,
|
|
24
|
+
AnonymizationConnectionError,
|
|
25
|
+
APIError,
|
|
26
|
+
TierRestrictionError,
|
|
27
|
+
ValidationError,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# Enums
|
|
31
|
+
# Response types
|
|
32
|
+
from anonymization_sdk.models import (
|
|
33
|
+
AnonymizeResult,
|
|
34
|
+
AttributeClassification,
|
|
35
|
+
AuditEntry,
|
|
36
|
+
AutoAnonymizeResult,
|
|
37
|
+
AutoConfigResult,
|
|
38
|
+
DetectionMode,
|
|
39
|
+
DetectionResult,
|
|
40
|
+
DPBudgetStatus,
|
|
41
|
+
DPComputeResult,
|
|
42
|
+
DPMechanismType,
|
|
43
|
+
DPNoiseType,
|
|
44
|
+
DPStreamMechanismType,
|
|
45
|
+
DPStreamResult,
|
|
46
|
+
JobHistoryEntry,
|
|
47
|
+
JobListResult,
|
|
48
|
+
JobResponse,
|
|
49
|
+
JobStatus,
|
|
50
|
+
JobStatusResponse,
|
|
51
|
+
JournalistRisk,
|
|
52
|
+
MarketerRisk,
|
|
53
|
+
MetricsResult,
|
|
54
|
+
ModelMetrics,
|
|
55
|
+
Pattern,
|
|
56
|
+
PatternListResult,
|
|
57
|
+
PrivacyModel,
|
|
58
|
+
ProsecutorRisk,
|
|
59
|
+
RiskLevel,
|
|
60
|
+
RiskResult,
|
|
61
|
+
SamplingMethod,
|
|
62
|
+
ValidationResult,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
for _dist_name in ("protegrity-anonymization-sdk", "anonymization-sdk"):
|
|
66
|
+
try:
|
|
67
|
+
__version__ = _pkg_version(_dist_name)
|
|
68
|
+
break
|
|
69
|
+
except PackageNotFoundError:
|
|
70
|
+
continue
|
|
71
|
+
else:
|
|
72
|
+
__version__ = "0+unknown"
|
|
73
|
+
|
|
74
|
+
__all__ = [
|
|
75
|
+
"__version__",
|
|
76
|
+
# Clients
|
|
77
|
+
"AnonymizationClient",
|
|
78
|
+
"AsyncAnonymizationClient",
|
|
79
|
+
# Enums
|
|
80
|
+
"PrivacyModel",
|
|
81
|
+
"DetectionMode",
|
|
82
|
+
"SamplingMethod",
|
|
83
|
+
"RiskLevel",
|
|
84
|
+
"JobStatus",
|
|
85
|
+
"DPMechanismType",
|
|
86
|
+
"DPStreamMechanismType",
|
|
87
|
+
"DPNoiseType",
|
|
88
|
+
# Response types
|
|
89
|
+
"DetectionResult",
|
|
90
|
+
"AttributeClassification",
|
|
91
|
+
"ModelMetrics",
|
|
92
|
+
"RiskResult",
|
|
93
|
+
"ProsecutorRisk",
|
|
94
|
+
"JournalistRisk",
|
|
95
|
+
"MarketerRisk",
|
|
96
|
+
"AnonymizeResult",
|
|
97
|
+
"AutoConfigResult",
|
|
98
|
+
"AutoAnonymizeResult",
|
|
99
|
+
"ValidationResult",
|
|
100
|
+
"MetricsResult",
|
|
101
|
+
"Pattern",
|
|
102
|
+
"PatternListResult",
|
|
103
|
+
"JobResponse",
|
|
104
|
+
"JobStatusResponse",
|
|
105
|
+
"JobHistoryEntry",
|
|
106
|
+
"JobListResult",
|
|
107
|
+
"DPComputeResult",
|
|
108
|
+
"DPStreamResult",
|
|
109
|
+
"DPBudgetStatus",
|
|
110
|
+
"AuditEntry",
|
|
111
|
+
# Exceptions
|
|
112
|
+
"AnonymizationClientError",
|
|
113
|
+
"AnonymizationConnectionError",
|
|
114
|
+
"APIError",
|
|
115
|
+
"ValidationError",
|
|
116
|
+
"TierRestrictionError",
|
|
117
|
+
# Constants
|
|
118
|
+
"DEFAULT_TIMEOUT",
|
|
119
|
+
"DEFAULT_BASE_URL",
|
|
120
|
+
]
|