magika

Identify file content types using Magika's ML model with CLI and Python API.

Updated Jul 10, 2023
One-click install
npx skills add https://github.com/iamtatsuki05/dotfiles --skill magika
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: magika
Source: https://github.com/iamtatsuki05/dotfiles/tree/main/dotfiles/.agent/skills/magika
Command: npx skills add https://github.com/iamtatsuki05/dotfiles --skill magika

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Magika identifies the content type of files using a ML model to replace traditional signature checks and to verify that file extensions align with content, enabling fast and accurate classification at scale.

Core Features & Use Cases

  • ML-based detection for 200+ content types with high accuracy
  • Verify extension vs content and classify files, directories, and streams
  • Provides CLI and Python API for automation and integration into workflows
  • Use cases include batch processing, data organization, and content routing

Quick Start

Identify the type of a file by running magika on its path and interpreting the resulting label.

Frequently Asked Questions about magika

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify file types accurately when extensions are misleading?

Magika identifies file content types using a machine-learning model to replace traditional signature checks. It verifies that file extensions align with actual content, returning structured results like label, mime_type, and score for accurate classification.

Can I automate file type detection for batch processing directories?

Yes, you can automate batch processing for directories and streams using Magika's CLI and Python API. It applies ML-based detection across multiple files, returning structured outputs like label and group for seamless workflow integration.

What is the best way to detect MIME types for unstructured data streams?

Detecting MIME types for streams is handled by applying an ML model directly to the data. Magika processes streams via its Python API, outputting the detected mime_type and a confidence score for each input.

Does machine learning file type identification support 200+ content types?

Yes, ML-based file type identification with Magika supports over 200 content types. It classifies files, directories, and streams, returning a content label, group, and extensions for each detected type.

How do I get structured results from a Python API for file classification?

You get structured results by calling the Python API to process file paths or streams. Magika returns structured output including label, mime_type, group, extensions, and score for direct integration into automation workflows.