Skip to main content

ahri mime

Project description

Ahri - ahri_mime

Github

Contact me ahriknow@gmail.com

How to use

  • install

    pip install ahri_mime
    
  • import

    from ahri_mime import get_ext, get_exts, get_type, get_types
    
  • The ahri_mime hasattr:

    attribute type explain
    MIME file include EXT_TO_TYPE and TYPE_TO_EXT
    EXT_TO_TYPE dict key is Extension, value is Type
    TYPE_TO_EXT dict key is Type, value is Extension
    get_ext function get Extension by type
    get_exts function get all Extensions by type
    get_type function get Type by ext
    get_types function get Types by ext
  • Example

    from ahri_mime import get_ext, get_exts, get_type, get_types
    
    
    def handle():
        print(get_ext('x-world/x-3dmf'))
        print(get_exts('x-world/x-3dmf', dot=False))
        print(get_type('docx', dot=False))
        print(get_types('.docx'))
    
    if __name__ == "__main__":
        handle()
    
    .3dm
    ['3dm', '3dmf', 'qd3', 'qd3d']
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
    ['application/vnd.openxmlformats-officedocument.wordprocessingml.document']
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ahri_mime-0.0.1.tar.gz (11.4 kB view hashes)

Uploaded Source

Built Distribution

ahri_mime-0.0.1-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page