Sanitize | Python SDK
Initializes a new Pangea service client.
Sanitize(token, config, logger_name)download-file
Sanitize.download_file()Poll result
Sanitize.poll_result(exception)Returns request's result that has been accepted by the server
response = service.poll_result(exception)
Sanitize via presigned URL
Sanitize.request_upload_url(transfer_method, params, file_scan, content, share_output, size, crc32c, sha256, uploaded_file_name)Apply file sanitization actions according to specified rules via a presigned URL.
presignedUrl = sanitize.request_upload_url(
transfer_method=TransferMethod.PUT_URL,
uploaded_file_name="uploaded_file",
)
# Upload file to `presignedUrl.accepted_result.put_url`.
# Poll for Sanitize's result.
response: PangeaResponse[SanitizeResult] = sanitize.poll_result(response=presignedUrl)
Sanitize
Sanitize.sanitize(transfer_method, file_path, file, source_url, share_id, file_scan, content, share_output, size, crc32c, sha256, uploaded_file_name, sync_call)Apply file sanitization actions according to specified rules.
with open("/path/to/file.pdf", "rb") as f:
response = sanitize.sanitize(
file=f,
transfer_method=TransferMethod.POST_URL,
uploaded_file_name="uploaded_file",
)