pangea-sdk 6.8.0__py3-none-any.whl → 6.9.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.
pangea/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "6.8.0"
1
+ __version__ = "6.9.0"
2
2
 
3
3
  from pangea.config import PangeaConfig
4
4
  from pangea.file_uploader import FileUploader
@@ -9,6 +9,7 @@ from __future__ import annotations
9
9
  from typing import Dict, List, Optional, Union
10
10
 
11
11
  import pangea.services.redact as m
12
+ from pangea._typing import T
12
13
  from pangea.asyncio.services.base import ServiceBaseAsync
13
14
  from pangea.config import PangeaConfig
14
15
  from pangea.response import PangeaResponse
@@ -182,11 +183,11 @@ class RedactAsync(ServiceBaseAsync):
182
183
  "v1/redact_structured", m.StructuredResult, data=input.model_dump(exclude_none=True)
183
184
  )
184
185
 
185
- async def unredact(self, redacted_data: m.RedactedData, fpe_context: str) -> PangeaResponse[m.UnredactResult]:
186
+ async def unredact(self, redacted_data: T, fpe_context: str) -> PangeaResponse[m.UnredactResult[T]]:
186
187
  """
187
188
  Unredact
188
189
 
189
- Decrypt or unredact fpe redactions
190
+ Decrypt or unredact FPE redactions
190
191
 
191
192
  OperationId: redact_post_v1_unredact
192
193
 
@@ -202,5 +203,6 @@ class RedactAsync(ServiceBaseAsync):
202
203
  available response fields can be found in our
203
204
  [API Documentation](https://pangea.cloud/docs/api/redact#unredact-post)
204
205
  """
205
- input = m.UnredactRequest(redacted_data=redacted_data, fpe_context=fpe_context)
206
- return await self.request.post("v1/unredact", m.UnredactResult, data=input.model_dump(exclude_none=True))
206
+ return await self.request.post(
207
+ "v1/unredact", m.UnredactResult, data={"redacted_data": redacted_data, "fpe_context": fpe_context}
208
+ )
pangea/services/redact.py CHANGED
@@ -9,6 +9,9 @@ from __future__ import annotations
9
9
  import enum
10
10
  from typing import Dict, List, Optional, Union
11
11
 
12
+ from typing_extensions import Generic
13
+
14
+ from pangea._typing import T
12
15
  from pangea.config import PangeaConfig
13
16
  from pangea.response import APIRequestModel, APIResponseModel, PangeaResponse, PangeaResponseResult
14
17
  from pangea.services.base import ServiceBase
@@ -174,28 +177,9 @@ class StructuredResult(PangeaResponseResult):
174
177
  """FPE context used to encrypt and redact data"""
175
178
 
176
179
 
177
- class UnredactRequest(APIRequestModel):
178
- """
179
- Class input to unredact data request
180
-
181
- Arguments:
182
- redacted_data: Data to unredact
183
- fpe_context (base64): FPE context used to decrypt and unredact data
184
- """
185
-
186
- redacted_data: RedactedData
187
- fpe_context: str
188
-
189
-
190
- RedactedData = Union[str, Dict]
191
-
192
-
193
- class UnredactResult(PangeaResponseResult):
194
- """
195
- Result class after an unredact request
196
- """
197
-
198
- data: RedactedData
180
+ class UnredactResult(PangeaResponseResult, Generic[T]):
181
+ data: T
182
+ """The unredacted data"""
199
183
 
200
184
 
201
185
  class Redact(ServiceBase):
@@ -364,11 +348,11 @@ class Redact(ServiceBase):
364
348
  )
365
349
  return self.request.post("v1/redact_structured", StructuredResult, data=input.model_dump(exclude_none=True))
366
350
 
367
- def unredact(self, redacted_data: RedactedData, fpe_context: str) -> PangeaResponse[UnredactResult]:
351
+ def unredact(self, redacted_data: T, fpe_context: str) -> PangeaResponse[UnredactResult[T]]:
368
352
  """
369
353
  Unredact
370
354
 
371
- Decrypt or unredact fpe redactions
355
+ Decrypt or unredact FPE redactions
372
356
 
373
357
  OperationId: redact_post_v1_unredact
374
358
 
@@ -384,5 +368,6 @@ class Redact(ServiceBase):
384
368
  available response fields can be found in our
385
369
  [API Documentation](https://pangea.cloud/docs/api/redact#unredact-post)
386
370
  """
387
- input = UnredactRequest(redacted_data=redacted_data, fpe_context=fpe_context)
388
- return self.request.post("v1/unredact", UnredactResult, data=input.model_dump(exclude_none=True))
371
+ return self.request.post(
372
+ "v1/unredact", UnredactResult, data={"redacted_data": redacted_data, "fpe_context": fpe_context}
373
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pangea-sdk
3
- Version: 6.8.0
3
+ Version: 6.9.0
4
4
  Summary: Pangea API SDK
5
5
  Keywords: Pangea,SDK,Audit
6
6
  Author: Glenn Gallien
@@ -8,11 +8,11 @@ Author-email: Glenn Gallien <glenn.gallien@pangea.cloud>
8
8
  License-Expression: MIT
9
9
  Classifier: Topic :: Software Development
10
10
  Classifier: Topic :: Software Development :: Libraries
11
- Requires-Dist: aiohttp>=3.13.0,<4.0.0
12
- Requires-Dist: cryptography>=46.0.2,<47.0.0
11
+ Requires-Dist: aiohttp>=3.13.1,<4.0.0
12
+ Requires-Dist: cryptography>=46.0.3,<47.0.0
13
13
  Requires-Dist: deprecated>=1.2.18,<2.0.0
14
14
  Requires-Dist: google-crc32c>=1.7.1,<2.0.0
15
- Requires-Dist: pydantic>=2.12.0,<3.0.0
15
+ Requires-Dist: pydantic>=2.12.3,<3.0.0
16
16
  Requires-Dist: python-dateutil>=2.9.0.post0,<3.0.0
17
17
  Requires-Dist: requests>=2.32.5,<3.0.0
18
18
  Requires-Dist: requests-toolbelt>=1.0.0,<2.0.0
@@ -1,4 +1,4 @@
1
- pangea/__init__.py,sha256=YNAWDtVJCD2ya_9rWjHp_k0zOxk2cXjhO1YQ0DPSthY,293
1
+ pangea/__init__.py,sha256=cMIrdQCIDgo-hpwnMerKPSslOyn-PnRfwjVRTR7WZ98,293
2
2
  pangea/_constants.py,sha256=gGGoQ6rhSiFEw1MKSGI588CHvFokG1Cf9SkkdPdRjVY,113
3
3
  pangea/_typing.py,sha256=pFBLkW2gPVZkgvMibQkovusQJZuGjhcqpkeRHnQrvds,798
4
4
  pangea/asyncio/__init__.py,sha256=96zytAbw70iKlqGwF12FCTf358_ijkBVNuo-1vBOyHI,79
@@ -14,7 +14,7 @@ pangea/asyncio/services/embargo.py,sha256=ctzj3kip6xos-Eu3JuOskrCGYC8T3JlsgAopZH
14
14
  pangea/asyncio/services/file_scan.py,sha256=5Ckb3cXKpcoO7KTUu6ejr1uC43-6EJb91WuGOHroRHE,7202
15
15
  pangea/asyncio/services/intel.py,sha256=WpQe8zN7T_y7OUzyYg3bu8yiKEH4iH1G60CRF6q5c60,39541
16
16
  pangea/asyncio/services/prompt_guard.py,sha256=VePQ0L1alkKyYiQppKqZIueVMF8ThxNPHQcom5iIMo8,2645
17
- pangea/asyncio/services/redact.py,sha256=356Kd5sww6wJsxA6DFIJvVEJle00n7HijdINb61YX9E,8014
17
+ pangea/asyncio/services/redact.py,sha256=NnDmNfP65PjqlOXUNXOL4dIVy4va4dYlfhHL_F2DTMQ,7992
18
18
  pangea/asyncio/services/sanitize.py,sha256=OybTAUfh_7vYRwb6Cjp4aHZoeHhIlg8caJ_BVrdbA1A,8691
19
19
  pangea/asyncio/services/share.py,sha256=AV9FbA-IMU5TFhcBtUHoXKDQYfOIWAJJZKW6vFohBbs,30816
20
20
  pangea/asyncio/services/vault.py,sha256=bYIUYmWYH8LqycfyDyNoS83BRWMd56t-RMt0B-TU8cQ,78564
@@ -44,7 +44,7 @@ pangea/services/embargo.py,sha256=3rE3ImjBg2VUXQljGZICedsr14psWdymC2pmmdJF2co,40
44
44
  pangea/services/file_scan.py,sha256=gSla3VUmgl3iA7DcrCf1BKopvunPG5ecIvX4DwzYOvc,7952
45
45
  pangea/services/intel.py,sha256=1aglQxS1skMM6RMdXdjIiRq3jv4hMTtp-DbFbuHj3Hs,55159
46
46
  pangea/services/prompt_guard.py,sha256=Fc0ujgIX-x_pqcUmZQT5itQv3bPxLBW2G5YZrkxhheI,3561
47
- pangea/services/redact.py,sha256=LJMHPK8hDxPLEVNfRgESAWgL4GBMiJC_pr1wXGb79W8,13225
47
+ pangea/services/redact.py,sha256=JSXGtugVt9USWr02OS3MT8BXclVT6Q84rsIZwDKSfpI,12906
48
48
  pangea/services/sanitize.py,sha256=0ZlCrEg8imJtRyovy4qZJb1ZAZ8ppIOQTj_nocBJ2CM,13019
49
49
  pangea/services/share/file_format.py,sha256=1svO1ee_aenA9zoO_AaU-Rk5Ulp7kcPOc_KwNoluyQE,2797
50
50
  pangea/services/share/share.py,sha256=IhTilqWcQ2GlsJ7kHHuVbXfNu8jvFtPBnEeM26SNsY8,52403
@@ -57,6 +57,6 @@ pangea/services/vault/vault.py,sha256=PJs1YlTud1cPnhyUDMguIEyhN0i-haG1kuzA_4hygE
57
57
  pangea/tools.py,sha256=JkwVplvx7MCPRSdPhFTLvOl6h7btaUbXEuHgUy0EHBU,6452
58
58
  pangea/utils.py,sha256=QwTODI_D8by86uXeA0MpdhJICvz5baKUtfv1rguQshU,4943
59
59
  pangea/verify_audit.py,sha256=-VepQKHtSqZRqhIKiUtLufa7ywwdMNLN2SuhingMooU,17288
60
- pangea_sdk-6.8.0.dist-info/WHEEL,sha256=X16MKk8bp2DRsAuyteHJ-9qOjzmnY0x1aj0P1ftqqWA,78
61
- pangea_sdk-6.8.0.dist-info/METADATA,sha256=viphu-M9tqiG5RBx4vSgGO6D0pK7UDfQxPcwbxMbIJo,8028
62
- pangea_sdk-6.8.0.dist-info/RECORD,,
60
+ pangea_sdk-6.9.0.dist-info/WHEEL,sha256=M6du7VZflc4UPsGphmOXHANdgk8zessdJG0DBUuoA-U,78
61
+ pangea_sdk-6.9.0.dist-info/METADATA,sha256=1hejXo-areA_pQMUp27BY5bsniOIamx5C3gh8j-hinI,8028
62
+ pangea_sdk-6.9.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.2
2
+ Generator: uv 0.9.5
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any