magika icon indicating copy to clipboard operation
magika copied to clipboard

how to list all possible format types in python?

Open rajdeinno opened this issue 1 year ago • 1 comments

image

In the web demo, I am able to see all kinds of possible formats in descending order. Is there any way to get these in python?

For now, I am seeing only the top category format with score.

Here is my python code.

 result = magika.identify_path(Path(root_folder + "\\" + file_path))      
   confidence = "{:.2f}%".format(result.output.score * 100)      
    print({"Filepath": file_path, "File type": str(result.output.ct_label),
                        "File Description": str(result.output.magic), "Description": str(result.output.description),
                        "Mime Type": str(result.output.mime_type),
                        "Group": str(result.output.group), "Confidence": str(confidence)})

rajdeinno avatar Feb 29 '24 10:02 rajdeinno