google / google/magika

Expose information about content type knowledge base

Open
#826 1 comment 0 reactions 0 assignees View on GitHub
enhancement python
Dominant language
Rust
Stars
18.6k
Forks
1.2k
Avg merge
3d 12h
Merged PRs (30d)
20

Description

In a previous version of the magika python package (e.g., `0.5.1`), we had a `ContentTypesManager` class that was wrapping the knowledge about content types and their metadata (e.g., mime types). This class was never meant to be used by external clients (nor it was documented). In the new version, this class has been refactored away, now content type labels are actual enums, and we track their metadata via a private field in the `Magika` object.

That being said, the content types knowledge base could be of some use to external clients. It may be worth exploring a clean way to expose this information.

One idea is to add a couple of methods to the `Magika` object to list all content types (all in our content types KB, or all supported by a given model) and one method to access the metadata (e.g., mime type) for a given content type.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Magika object’s private content-type metadata field and the prior ContentTypesManager described in the issue. Explore a public API for listing content types and retrieving metadata such as MIME types; done means the exposure approach is cleanly defined for external clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.