File Scan | Python SDK
Initializes a new Pangea service client.
FileScan(token, config, logger_name)download-file
FileScan.download_file()Scan
FileScan.file_scan(file_path, file, verbose, raw, provider, sync_call, transfer_method, source_url)Scan a file for malicious content.
try:
with open("./path/to/file.pdf", "rb") as f:
response = client.file_scan(file=f, verbose=True, provider="crowdstrike")
print(f"Response: {response.result}")
except pe.PangeaAPIException as e:
print(f"Request Error: {e.response.summary}")
for err in e.errors:
print(f"\t{err.detail} \n")
Poll result
FileScan.poll_result(exception)Returns request's result that has been accepted by the server
response = service.poll_result(exception)