# Checksum calculations md5_hash = hashlib.md5(open(file_path, "rb").read()).hexdigest() sha1_hash = hashlib.sha1(open(file_path, "rb").read()).hexdigest() sha256_hash = hashlib.sha256(open(file_path, "rb").read()).hexdigest()
# Example usage file_path = "path/to/Apone3D_2022-12.zip" features = get_file_features(file_path) for feature, value in features.items(): print(f"{feature}: {value}") This script provides a basic set of features. Depending on your needs, you might want to inspect the contents of the zip file further or compute additional checksums and metadata. Apone3D_2022-12.zip
# Zip file specifics try: with zipfile.ZipFile(file_path) as zip_ref: num_files = len(zip_ref.namelist()) info = zip_ref.infolist() # You can inspect the info list for more details about each file except zipfile.BadZipFile: num_files = None info = None # Checksum calculations md5_hash = hashlib