Commit 8a2160e
committed
feat: add get_content_type_info() public API method (fixes #826)
Root cause: the content type knowledge base (mime_type, group,
description, extensions, is_text) was only accessible via the private
_get_ct_info() method and the internal _cts_infos dict, with no
supported public interface for external clients.
Fix: expose a new public method Magika.get_content_type_info(label)
that returns the ContentTypeInfo for any label in the knowledge base,
raising MagikaError (rather than a bare KeyError) for unknown labels.
This completes the content-type introspection API alongside the existing
get_output_content_types() and get_model_content_types() methods.1 parent 7056c1f commit 8a2160e
File tree
2 files changed
+55
-0
lines changed- python
- src/magika
- tests
2 files changed
+55
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
259 | 283 | | |
260 | 284 | | |
261 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
764 | 795 | | |
765 | 796 | | |
766 | 797 | | |
| |||
0 commit comments