Skip to main content

File Intel | Python SDK

The File Intel service enables you to submit a file's hash and get the file's attributes back - giving you insight into the disposition of the file.

init

FileIntel()

download-file

FileIntel.download_file()

Reputation, from filepath

FileIntel.filepath_reputation(filepath, provider, verbose, raw)

Retrieve a reputation score for a file hash from a provider, including an optional detailed report. This function calculates a hash from the file at a given filepath and makes a request to the service.

required parameters

str

The path to the file to be looked up

optional parameters

str

Use reputation data from these providers: "reversinglabs" or "crowdstrike"

bool

Echo the API parameters in the response

bool

Include raw data from this provider

Response Object

A PangeaResponse where the sanctioned source(s) are in the response.result field. Available response fields can be found in our API documentation.

response = file_intel.filepath_reputation(
    filepath="./myfile.exe",
    provider="reversinglabs",
)

Reputation, from filepath V2

FileIntel.filepath_reputation_bulk(filepaths, provider, verbose, raw)

Retrieve reputation scores for a list of file hashes from a provider, including an optional detailed report. This function calculates hashes from the files at the given filepaths and makes a request to the service.

required parameters

List[str]

The path list to the files to be looked up

optional parameters

str

Use reputation data from these providers: "reversinglabs" or "crowdstrike"

bool

Echo the API parameters in the response

bool

Include raw data from this provider

Response Object

A PangeaResponse where the sanctioned source(s) are in the response.result field. Available response fields can be found in our API documentation.

response = file_intel.filepath_reputation_bulk(
    filepaths=["./myfile.exe"],
    provider="reversinglabs",
)

Reputation check

FileIntel.hash_reputation(hash, hash_type, provider, verbose, raw)

Retrieve a reputation score for a file hash from a provider, including an optional detailed report.

required parameters

str

The hash of the file to be looked up

str

One of "sha256", "sha", "md5"

optional parameters

str

Use reputation data from these providers: "reversinglabs" or "crowdstrike"

bool

Echo the API parameters in the response

bool

Include raw data from this provider

Response Object

A PangeaResponse where the sanctioned source(s) are in the response.result field. Available response fields can be found in our API documentation.

response = file_intel.hash_reputation(
    hash="179e2b8a4162372cd9344b81793cbf74a9513a002eda3324e6331243f3137a63",
    hash_type="sha256",
    provider="reversinglabs",
)

Reputation check V2

FileIntel.hash_reputation_bulk(hashes, hash_type, provider, verbose, raw)

Retrieve reputation scores for a set of file hashes from a provider, including an optional detailed report.

required parameters

List[str]

The hash of each file to be looked up

str

One of "sha256", "sha", "md5"

optional parameters

str

Use reputation data from these providers: "reversinglabs" or "crowdstrike"

bool

Echo the API parameters in the response

bool

Include raw data from this provider

Response Object

A PangeaResponse where the sanctioned source(s) are in the response.result field. Available response fields can be found in our API documentation.

response = file_intel.hash_reputation_bulk(
    hashes=["179e2b8a4162372cd9344b81793cbf74a9513a002eda3324e6331243f3137a63"],
    hash_type="sha256",
    provider="reversinglabs",
)

Poll result

FileIntel.poll_result(exception)

Returns request's result that has been accepted by the server

required parameters

AcceptedRequestException

Exception raise by SDK on the call that is been processed.

Response Object

PangeaResponse

response = service.poll_result(exception)