Skip to content

Convert between file extensions and mimetypes and vice-versa

License

Notifications You must be signed in to change notification settings

EOSC-Data-Commons/mimedb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mimedb

Convert between file extensions and mimetypes and vice-versa. Uses source files from mime-db (https://github.com/jshttp/mime-db) and galaxy-datatypes (https://github.com/galaxyproject/galaxy).

Installation

uv add https://github.com/Dans-labs/mimedb.git

Usage

import mimedb
# Get mimetype from file extension
#[('galaxy', 'galaxy.datatypes.sequence:Fasta')]
(source, mime_type) = mimedb.get_types("fasta")
# Get file extension from mimetype
# ["json", ...]
json_file_extensions = mimedb.get_extensions("application/json")
# Get equivalent types
# ['galaxy.datatypes.text:json', ...]
json_equivalents = mimedb.equivalent_types("application/json")

About

Convert between file extensions and mimetypes and vice-versa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%