Retrieve checksum details using the SDK
This guide provides step-by-step instructions to retrieve checksum, if available, for components in a dataset using the SDK.
Checksums are available for:
- Dataset uploaded through the front-end (including images), only if the component size is less than 15 Mo.
- Dataset uploaded using the SDK version ≥2.11
- Dataset generated by Aether analytics
- Dataset generated by custom analytics based on SDK version ≥2.11.
Prerequisites
Install the SDK https://alteia.readthedocs.io/en/latest/first_steps.htm
Step 1: Find the Dataset ID
To locate the dataset ID, use the dataset name along with the company and project identifiers:
dataset_id= sdk.datasets.search(filter={"company": { "$eq": "company_id" }, "project": {"$eq": "project_id" },"name": {"$match": "dataset_name"}})
Step 2: Retrieve Dataset Details
Once you have the dataset ID, describe the dataset to fetch its metadata:
my_dataset = sdk.datasets.describe(dataset_id[0]._id)
Step 3: Extract and Display Checksum Information
Iterate over the dataset components to extract and display filename-checksum pairs:
checksum_info = [(component['filename'], component['checksum']) for component in my_dataset.components if 'checksum' in component and 'filename' in component]
Output
The output will be a list of tuples, where each tuple contains the filename and its corresponding checksum:
for info in checksum_info:
filename,checksum=info
print(f"File name = {filename}, checksum={checksum}")
Example of output for 3d model
File name = structure.obj, checksum=<checksum for file structure.obj >
File name = material.mtl, checksum=<checksum for file material-texture.mtl>
File name = img.jpg, checksum=<checksum for file img.jpg>