{ "info": { "author": "Chris Griffith", "author_email": "chris@cdgriffith.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Utilities" ], "description": "puremagic\n=========\n\npuremagic is a pure python module that will identify a file based off\nit's magic numbers.\n\n|BuildStatus| |CoverageStatus| |License| |PyPi|\n\nIt is designed to be minimalistic and inherently cross platform\ncompatible. It is also designed to be a stand in for python-magic, it\nincorporates the functions from\\_file(filename[, mime]) and\nfrom\\_string(string[, mime]) however the magic\\_file() and\nmagic\\_string() are more powerful and will also display confidence and\nduplicate matches.\n\nIt does NOT try to match files off non-magic string. In other words it\nwill not search for a string within a certain window of bytes like\nothers might.\n\nAdvantages over using a wrapper for 'file' or 'libmagic':\n\n- Faster\n- Lightweight\n- Cross platform compatible\n- No dependencies\n\nDisadvantages:\n\n- Does not have as many file types\n- No multilingual comments\n- Duplications due to small or reused magic numbers\n\n(Help fix the first two disadvantages by contributing!)\n\nCompatibility\n~~~~~~~~~~~~~\n\n- Python 2.7+\n- Python 3.4+\n- Pypy\n\nUsing travis-ci to run continuous integration tests on listed platforms.\n\nInstall\n-------\n\nIn either a virtualenv or globally, simply run:\n\n.. code:: bash\n\n $ python setup.py install\n\nIt has no dependencies (other than the 2.7+ built-in argparse)\n\nUsage\n-----\n\n\"from_file\" will return the most likely file extension. \"magic_file\"\nwill give you every possible result it finds, as well as the confidence.\n\n.. code:: python\n\n import puremagic\n\n filename = \"test/resources/images/test.gif\"\n\n ext = puremagic.from_file(filename)\n # '.gif'\n\n puremagic.magic_file(filename)\n # [['.gif', 'image/gif', 'Graphics interchange format file (GIF87a)', 0.7],\n # ['.gif', '', 'GIF file', 0.5]]\n\nWith \"magic_file\" it gives each match, highest confidence first:\n\n- possible extension(s)\n- mime type\n- description\n- confidence (All headers have to perfectly match to make the list,\n however this orders it by longest header, therefore most precise,\n first)\n\nScript\n------\n\n*Usage*\n\n.. code:: bash\n\n $ python -m puremagic [options] filename ...\n\n*Examples*\n\n.. code:: bash\n\n $ python -m puremagic test/resources/images/test.gif\n 'test/resources/images/test.gif' : .gif\n\n $ python -m puremagic -m test/resources/images/test.gif test/resources/audio/test.mp3\n 'test/resources/images/test.gif' : image/gif\n 'test/resources/audio/test.mp3' : audio/mpeg\n\nFAQ\n---\n\n*The file type is actually X but it's showing up as Y with higher\nconfidence?*\n\nThis can happen when the file's signature happens to match a subset of a\nfile standard. The subset signature will be longer, therefore report\nwith greater confidence, because it will have both the base file type\nsignature plus the additional subset one.\n\n*You don't have sliding offsets that could better detect plenty of\ncommon formats, why's that?*\n\nDesign choice, so it will be a lot faster and more accurate. Without\nmore intelligent or deeper identification past a sliding offset I don't\nfeel comfortable including it as part of a 'magic number' library.\n\n*Your version isn't as complete as I want it to be, where else should I\nlook?*\n\nLook into python modules that wrap around libmagic or use something like\nApache Tika.\n\nAcknowledgements\n----------------\n\nGary C. Kessler\n\n\nFor use of his File Signature Tables, available at:\nhttp://www.garykessler.net/library/file_sigs.html\n\nFreedesktop.org\n\nFor use of their shared-mime-info file (even if they do use XML, blea), available at:\nhttps://cgit.freedesktop.org/xdg/shared-mime-info/\n\nLicense\n-------\n\nMIT Licenced, see LICENSE, Copyright (c) 2013-2019 Chris Griffith\n\n.. |BuildStatus| image:: https://travis-ci.org/cdgriffith/puremagic.png?branch=master\n :target: https://travis-ci.org/cdgriffith/puremagic\n.. |CoverageStatus| image:: https://coveralls.io/repos/github/cdgriffith/puremagic/badge.svg?branch=develop\n :target: https://coveralls.io/github/cdgriffith/puremagic?branch=develop\n.. |PyPi| image:: https://img.shields.io/pypi/v/puremagic.svg?maxAge=2592000\n :target: https://pypi.python.org/pypi/puremagic/\n.. |License| image:: https://img.shields.io/pypi/l/puremagic.svg\n :target: https://pypi.python.org/pypi/puremagic/\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cdgriffith/puremagic", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "puremagic", "package_url": "https://pypi.org/project/puremagic/", "platform": "any", "project_url": "https://pypi.org/project/puremagic/", "project_urls": { "Homepage": "https://github.com/cdgriffith/puremagic" }, "release_url": "https://pypi.org/project/puremagic/1.6/", "requires_dist": [ "argparse", "nose (>=1.3) ; extra == 'testing'", "coverage (>=3.6) ; extra == 'testing'", "argparse ; extra == 'testing'" ], "requires_python": "", "summary": "Pure python implementation of magic file detection", "version": "1.6" }, "last_serial": 5973700, "releases": { "1.2": [ { "comment_text": "", "digests": { "md5": "edb5e8580dd1de944db168220ac4478f", "sha256": "30c7f9f430a2a31464e46f576dc5871d8cd160c7869fde607c70cc46e609552f" }, "downloads": -1, "filename": "puremagic-1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "edb5e8580dd1de944db168220ac4478f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 28847, "upload_time": "2016-12-15T23:56:50", "url": "https://files.pythonhosted.org/packages/e7/69/9b450bf7c5dac48d362d27aec4bb4d42b6cace766ad0c0deb52896fe81b8/puremagic-1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b07427b74b839fab3a01a9b57614fc5f", "sha256": "ceac2c3438858a2380dfb597f36e6577b83f77ded9d12d5731cc0563cb423a20" }, "downloads": -1, "filename": "puremagic-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b07427b74b839fab3a01a9b57614fc5f", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 28847, "upload_time": "2016-12-15T23:56:52", "url": "https://files.pythonhosted.org/packages/5e/37/65cc8f53a6bdce731f09c86a5312a7df2cfa646664aa293d3c80d9fa50e7/puremagic-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "38ee4bcc49d7740506e53e4b7ffb5b99", "sha256": "048a14fbc594474ce4a9f65eb5d159a93e4d3bb81236d2c1311f9c9fde6dd960" }, "downloads": -1, "filename": "puremagic-1.2.tar.gz", "has_sig": false, "md5_digest": "38ee4bcc49d7740506e53e4b7ffb5b99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6528, "upload_time": "2016-12-15T23:56:48", "url": "https://files.pythonhosted.org/packages/97/45/c684c75ca5832f2d7b45e9b3d71014f505b9b41d548400415929e8830f64/puremagic-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "4ccc3af50f61f72465e7119e2dfc9e2b", "sha256": "169861ba84aef8cb629f6fde8dcd85f9f655f5df18e247828523ca95bc04ce5b" }, "downloads": -1, "filename": "puremagic-1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "4ccc3af50f61f72465e7119e2dfc9e2b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 29147, "upload_time": "2017-04-03T04:26:33", "url": "https://files.pythonhosted.org/packages/13/f0/a832c35bda1cc4ba21609ee3a3377e292186c8cb7c96d7eb6dfe6c3f2385/puremagic-1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0b801583ec9523ded58a4145f96eb782", "sha256": "b362ddc1f0ba25a6a3bb4a8ba04c81f2b2062c96dd8a5462c09714370695e348" }, "downloads": -1, "filename": "puremagic-1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0b801583ec9523ded58a4145f96eb782", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 29147, "upload_time": "2017-04-03T04:26:36", "url": "https://files.pythonhosted.org/packages/f4/7a/57583e43a749cd14ec19c74c0d2ae138428af6dbe91008b6ec88e3c5d8d8/puremagic-1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f490f33ab3bd7dff692f26a7e460ff6", "sha256": "6df47fdcd87dc7202ff71a58f4ac661ebb7a065a3b81d331669574919b191492" }, "downloads": -1, "filename": "puremagic-1.3.tar.gz", "has_sig": false, "md5_digest": "5f490f33ab3bd7dff692f26a7e460ff6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7340, "upload_time": "2017-04-03T04:26:31", "url": "https://files.pythonhosted.org/packages/17/98/ccf403df50c5bce9179739a825804a4c399542c608afb675feb5305bde41/puremagic-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "04a3aa306c73b9a2f0136f69dd37084a", "sha256": "e48a0b7f899136c50b4d4ba0014d79fe7c30ebbfb7d0794b22b2f3de69d37fb3" }, "downloads": -1, "filename": "puremagic-1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "04a3aa306c73b9a2f0136f69dd37084a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 26649, "upload_time": "2018-05-08T23:55:24", "url": "https://files.pythonhosted.org/packages/ee/99/ec7954239b2c5f25cdd4c7ae97b19a8ed944148b48f3eaafb43c0fad89b1/puremagic-1.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d344f31a1d818d8eb9a9e29c5e5020af", "sha256": "bdf727747220e9c221ecd4d06267dab7acfd78cfacb3923cc2506096558ad454" }, "downloads": -1, "filename": "puremagic-1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "d344f31a1d818d8eb9a9e29c5e5020af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26611, "upload_time": "2018-05-08T23:55:25", "url": "https://files.pythonhosted.org/packages/19/fe/343eabd56fd290f6a8b3e32512f8cd368f49eaf7eae57d70a987bd19ff44/puremagic-1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29779727b4b34619023d0209587db17a", "sha256": "f4021d2579fc147c580cbd12984adb0f9ceb044f9d61d0ddde466b256b62b5e8" }, "downloads": -1, "filename": "puremagic-1.4.tar.gz", "has_sig": false, "md5_digest": "29779727b4b34619023d0209587db17a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7413, "upload_time": "2018-05-08T23:56:05", "url": "https://files.pythonhosted.org/packages/02/97/33d2efcf5121ec52e0268aa1f0ff0dc26d8d4a659fcb988f514644c606f3/puremagic-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "edef62d776565cd2a2f62d9ce3c2fdc5", "sha256": "9fd50529e5ccb9a25cdfacb6ded1fef5ab3b21594ea5e5579353378a6848e612" }, "downloads": -1, "filename": "puremagic-1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "edef62d776565cd2a2f62d9ce3c2fdc5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27627, "upload_time": "2019-02-21T02:00:03", "url": "https://files.pythonhosted.org/packages/49/a7/ecbbb6f1addde6d0f463ce34ec452a74743a4900ebfef22a89ff92bae0e4/puremagic-1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43ea3bd35f4e6d418431169a70aa8750", "sha256": "fade7ec5a36475029ff0969c78959b9251bd5494d4268a607db8257f0ae8a35f" }, "downloads": -1, "filename": "puremagic-1.5.tar.gz", "has_sig": false, "md5_digest": "43ea3bd35f4e6d418431169a70aa8750", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29986, "upload_time": "2019-02-21T02:00:04", "url": "https://files.pythonhosted.org/packages/9d/13/da6e85ff90110844e6353dc3ed15c0d09ae284c751cea08c7e47edb1fa75/puremagic-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "6c09f85e1b70f8266af1b361a575e9e8", "sha256": "57eb87175a1fd9a67638d55875ae1b31e27d4ca38b3f079cdca8480b99272950" }, "downloads": -1, "filename": "puremagic-1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6c09f85e1b70f8266af1b361a575e9e8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27931, "upload_time": "2019-10-14T22:07:55", "url": "https://files.pythonhosted.org/packages/0f/6b/264eb4df14cc369955a75db5b2290f266fd43dc2cb1b46ea2cb68bf4de63/puremagic-1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a235b4b2c7e23ae2d55188b370b2bfc", "sha256": "b9a6a29a34c726286313d2f3eb118d76f7c24103348b1044c033b6f7584e16be" }, "downloads": -1, "filename": "puremagic-1.6.tar.gz", "has_sig": false, "md5_digest": "1a235b4b2c7e23ae2d55188b370b2bfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31639, "upload_time": "2019-10-14T22:07:57", "url": "https://files.pythonhosted.org/packages/5b/07/f9a2be43d7fdf8f5aeeb501513ec6882d6409662543bf4bdd5671ca5710b/puremagic-1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6c09f85e1b70f8266af1b361a575e9e8", "sha256": "57eb87175a1fd9a67638d55875ae1b31e27d4ca38b3f079cdca8480b99272950" }, "downloads": -1, "filename": "puremagic-1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6c09f85e1b70f8266af1b361a575e9e8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27931, "upload_time": "2019-10-14T22:07:55", "url": "https://files.pythonhosted.org/packages/0f/6b/264eb4df14cc369955a75db5b2290f266fd43dc2cb1b46ea2cb68bf4de63/puremagic-1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a235b4b2c7e23ae2d55188b370b2bfc", "sha256": "b9a6a29a34c726286313d2f3eb118d76f7c24103348b1044c033b6f7584e16be" }, "downloads": -1, "filename": "puremagic-1.6.tar.gz", "has_sig": false, "md5_digest": "1a235b4b2c7e23ae2d55188b370b2bfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31639, "upload_time": "2019-10-14T22:07:57", "url": "https://files.pythonhosted.org/packages/5b/07/f9a2be43d7fdf8f5aeeb501513ec6882d6409662543bf4bdd5671ca5710b/puremagic-1.6.tar.gz" } ] }