{ "info": { "author": "liluo", "author_email": "i@liluo.org", "bugtrack_url": null, "classifiers": [ "Operating System :: POSIX", "Programming Language :: Python" ], "description": "MIME\n====\n[![Build Status](https://travis-ci.org/liluo/mime.png)](https://travis-ci.org/liluo/mime)\n\nMIME Types for Python, clone of [halostatue/mime-types](https://github.com/halostatue/mime-types).\n\nThis library allows for the identification of a file's likely MIME content type.\n\nMIME types are used in MIME-compliant communications, as in e-mail or HTTP\ntraffic, to indicate the type of content which is transmitted. MIME Types\nprovides the ability for detailed information about MIME entities (provided as\na set of MIME Type objects) to be determined and used programmatically. There\nare many types defined by RFCs and vendors, so the list is long but not\ncomplete; don't hesitate to ask to add additional information. This library\nfollows the IANA collection of MIME types (see below for reference).\n\nMIME Types is built to conform to the MIME types of RFCs 2045 and 2231. It\ntracks the [IANA registry](http://www.iana.org/assignments/media-types/)\n([ftp](ftp://ftp.iana.org/assignments/media-types)) with some unofficial types\nadded from the [LTSW collection](http://www.ltsw.se/knbase/internet/mime.htp)\nand added by the users of MIME Types.\n\n### Installation\n\n```bash\npip install mime\n```\n\nor\n\n```bash\neasy_install mime\n```\n\n### Features\n\nMIME types are used in MIME entities, as in email or HTTP traffic.\nIt is useful at times to have information available about MIME types (or, inversely, about files).\nA MIME Type stores the known information about one MIME type.\n\n```bash\nimport mime\n\nplaintext = mime.Types['text/plain']\n# => [, ]\ntext = plaintext[0]\n\nprint text.media_type # => 'text'\nprint text.sub_type # => 'plain'\nprint ' '.join(text.extensions) # => 'txt asc c cc h hh cpp hpp dat hlp'\n\nprint text.encoding # => 'quoted-printable'\nprint text.is_binary # => False\nprint text.is_ascii # => True\nprint text.is_obsolete # => False\nprint text.is_registered # => True\nprint str(text) == 'text/plain' # => True\nprint mime.Type.simplify('x-appl/x-zip') # => 'appl/zip'\n\nprint mime.Types.any(lambda t: t.content_type == 'text/plain') # => True\nprint mime.Types.all(lambda t: t.is_registered) # => False\n\npy = mime.Types.of('script.py')[0]\nprint py.content_type # => 'application/x-python'\nprint py.encoding # => '8bit'\nprint py.is_binary # => False\nprint py.simplified # => 'application/python'\n\nrb_types = mime.Types.of('script.rb')\nrb = rb_types[0]\nprint rb.content_type # => 'application/x-ruby'\nprint rb.is_ascii # => True\nprint rb.extensions # => ['rb', 'rbw']\n\nimport re\nimage_types = mime.Types[re.compile('image')]\n# => [, , ...]\nprint mime.Types.count() # => 1643\n```\n\n### Contributing\n\n```bash\n* Fork the repository.\n* Create a topic branch.\n* Implement your feature or bug fix.\n* Add, commit, and push your changes.\n* Submit a pull request.\n```\n\n#### Testing\n\n```bash\ncd tests/\npython run.py\n```\n\n### Changelog\n__v0.1.0 [2016-08-04]__\n* Support Python 3.x\n\n__v0.0.3 [2013-11-07]__\n* Remove print.\n\n__v0.0.2 [2013-08-27]__\n* It's worked.\n\n__v0.0.1 [2013-08-13]__\n* Register name.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/liluo/mime", "keywords": "mime types", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "mime", "package_url": "https://pypi.org/project/mime/", "platform": "POSIX", "project_url": "https://pypi.org/project/mime/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/liluo/mime" }, "release_url": "https://pypi.org/project/mime/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "MIME Types", "version": "0.1.0" }, "last_serial": 2261280, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0ec9b82a86b43046e3211b99b179899f", "sha256": "e75d0bfa050bdd68c7fd5c71485de4ae00b2421c944f6eb6f420c30d60140721" }, "downloads": -1, "filename": "mime-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0ec9b82a86b43046e3211b99b179899f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 792, "upload_time": "2013-08-14T02:29:08", "url": "https://files.pythonhosted.org/packages/44/07/f354fd50f8b6144887250a28409ce59d25556c006e268355e4c4d33e064c/mime-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2669893651e09ede35dceaafce43f7b7", "sha256": "bcf75f69705917ad253f1f46de78fd4ccc8bb64aab7da0988c60604829352b7b" }, "downloads": -1, "filename": "mime-0.0.2-py2.7.egg", "has_sig": false, "md5_digest": "2669893651e09ede35dceaafce43f7b7", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 54311, "upload_time": "2013-08-27T05:47:08", "url": "https://files.pythonhosted.org/packages/95/0f/afd44966f5406df2853147c228f94141646fb155a3033d966748728831e8/mime-0.0.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "e6cdd22a9b41989ce0f17e18ffde140e", "sha256": "7914363868ecb6b37d04ce59b1cbe9d9e9e12c190d775269ab67b197c1d64e03" }, "downloads": -1, "filename": "mime-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e6cdd22a9b41989ce0f17e18ffde140e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31759, "upload_time": "2013-08-27T05:47:04", "url": "https://files.pythonhosted.org/packages/98/1b/784aa859cb0d4c92ae3deafa87e48c7d8c74340e35717ea6f9c7e9e0fac4/mime-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2ffe174646f3fd75513db2295b7c49af", "sha256": "deefd81bb79d0bbe01ad1e21828b5f3f1098702111d23522d2cc83fb19662449" }, "downloads": -1, "filename": "mime-0.0.3-py2.7.egg", "has_sig": false, "md5_digest": "2ffe174646f3fd75513db2295b7c49af", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 54342, "upload_time": "2013-11-07T08:10:58", "url": "https://files.pythonhosted.org/packages/ed/f2/4f9abce8adf53f24b01701776567aa442f7c117c8861def7eb37c37efb00/mime-0.0.3-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "272347947aa8786d96273db1fce5cc54", "sha256": "2f0171d64248bf273ec31cd18fdbdac10367cb8860b6fb55e8820dca7a311d7c" }, "downloads": -1, "filename": "mime-0.0.3.tar.gz", "has_sig": false, "md5_digest": "272347947aa8786d96273db1fce5cc54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31751, "upload_time": "2013-11-07T08:10:54", "url": "https://files.pythonhosted.org/packages/f2/24/ef51f8556992a8c2463afef0c000ff97a5098fa3cfbca50c57fbae1e5fcc/mime-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "fd5364163da85a1f49a831fda17754c0", "sha256": "09b69dd69e117029c13ac06018bdad054247513208ce9f78a8bddfa20d23b2d1" }, "downloads": -1, "filename": "mime-0.1.0-py3.5.egg", "has_sig": false, "md5_digest": "fd5364163da85a1f49a831fda17754c0", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 56503, "upload_time": "2016-08-04T06:28:28", "url": "https://files.pythonhosted.org/packages/c6/39/7a6b53d24cce60147ae53be9e72adfdc6b23ee1c45cce3ef27abd5eab61d/mime-0.1.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "2905e89847b9e664abf4dfd744e2d73d", "sha256": "11f010bf1bde055eb62eee707997f5bc7682daccf4993f704d97b350f7c34ce8" }, "downloads": -1, "filename": "mime-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2905e89847b9e664abf4dfd744e2d73d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32133, "upload_time": "2016-08-04T06:28:23", "url": "https://files.pythonhosted.org/packages/c3/94/d211d0a0e1ad71d7b42dc85531f9aa463393bcbee71b9492b2881361406e/mime-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fd5364163da85a1f49a831fda17754c0", "sha256": "09b69dd69e117029c13ac06018bdad054247513208ce9f78a8bddfa20d23b2d1" }, "downloads": -1, "filename": "mime-0.1.0-py3.5.egg", "has_sig": false, "md5_digest": "fd5364163da85a1f49a831fda17754c0", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 56503, "upload_time": "2016-08-04T06:28:28", "url": "https://files.pythonhosted.org/packages/c6/39/7a6b53d24cce60147ae53be9e72adfdc6b23ee1c45cce3ef27abd5eab61d/mime-0.1.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "2905e89847b9e664abf4dfd744e2d73d", "sha256": "11f010bf1bde055eb62eee707997f5bc7682daccf4993f704d97b350f7c34ce8" }, "downloads": -1, "filename": "mime-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2905e89847b9e664abf4dfd744e2d73d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32133, "upload_time": "2016-08-04T06:28:23", "url": "https://files.pythonhosted.org/packages/c3/94/d211d0a0e1ad71d7b42dc85531f9aa463393bcbee71b9492b2881361406e/mime-0.1.0.tar.gz" } ] }