{ "info": { "author": "Audrey Roy Greenfeld", "author_email": "aroy@alum.mit.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "=============================\nBinaryOrNot\n=============================\n\n.. image:: https://img.shields.io/pypi/v/binaryornot.svg?style=flat\n :target: https://pypi.python.org/pypi/binaryornot\n\n.. image:: https://readthedocs.org/projects/binaryornot/badge/?version=latest\n :target: http://binaryornot.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\n.. image:: https://pyup.io/repos/github/audreyr/binaryornot/shield.svg\n :target: https://pyup.io/repos/github/audreyr/binaryornot/\n :alt: Updates\n\nUltra-lightweight pure Python package to guess whether a file is binary or text,\nusing a heuristic similar to Perl's `pp_fttext` and its analysis by @eliben.\n\n* Free software: BSD license\n* Documentation: https://binaryornot.readthedocs.io\n\nStatus\n------\n\nIt works, and people are using this package in various places. But it doesn't cover all edge cases yet.\n\nThe code could be improved. Pull requests welcome! As of now, it is based on these snippets, but that may change:\n\n* http://stackoverflow.com/questions/898669/how-can-i-detect-if-a-file-is-binary-non-text-in-python\n* http://stackoverflow.com/questions/1446549/how-to-identify-binary-and-text-files-using-python\n* http://code.activestate.com/recipes/173220/\n* http://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/\n\nFeatures\n--------\n\nHas tests for these file types:\n\n* Text: .txt, .css, .json, .svg, .js, .lua, .pl, .rst\n* Binary: .png, .gif, .jpg, .tiff, .bmp, .DS_Store, .eot, .otf, .ttf, .woff, .rgb\n\nHas tests for numerous encodings.\n\nWhy?\n----\n\nYou may be thinking, \"I can write this in 2 lines of code?!\"\n\nIt's actually not that easy. Here's a great article about how Perl's\nheuristic to guess file types works: http://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/\n\nAnd that's just where we started. Over time, we've found more edge cases and\nour heuristic has gotten more complex.\n\nAlso, this package saves you from having to write and thoroughly test\nyour code with all sorts of weird file types and encodings, cross-platform.\n\nBuilds\n------\n\nLinux (Ubuntu 12.04 LTS Server Edition 64 bit):\n\n.. image:: https://img.shields.io/travis/audreyr/binaryornot/master.svg\n :target: https://travis-ci.org/audreyr/binaryornot\n\nWindows (Windows Server 2012 R2 (x64)):\n\n.. image:: https://img.shields.io/appveyor/ci/audreyr/binaryornot/master.svg\n :target: https://ci.appveyor.com/project/audreyr/binaryornot\n\nCredits\n-------\n\n* Special thanks to Eli Bendersky (@eliben) for his writeup explaining the heuristic and his implementation, which this is largely based on.\n* Source code from the portion of Perl's `pp_fttext` that checks for textiness: https://github.com/Perl/perl5/blob/v5.23.1/pp_sys.c#L3527-L3587\n\n\n\n\nHistory\n-------\n\n0.4.4 (2017-04-13)\n~~~~~~~~~~~~~~~~~~\n\n* Notify users for file i/o issues. Thanks @lukehinds!\n\n\n0.4.3 (2017-04-13)\n~~~~~~~~~~~~~~~~~~\n\n* Restricted chardet to anything 3.0.2 or higher due to https://github.com/chardet/chardet/issues/113. Thanks @dan-blanchard for the quick fix!\n\n0.4.2 (2017-04-12)\n~~~~~~~~~~~~~~~~~~\n\n* Restricted chardet to anything under 3.0 due to https://github.com/chardet/chardet/issues/113\n* Added pyup badge\n* Added utilities for pushing new versions up\n\n0.4.0 (2015-08-21)\n~~~~~~~~~~~~~~~~~~\n\n* Enhanced detection for some binary streams and UTF texts. (#10, 11) Thanks `@pombredanne`_.\n* Set up Appveyor for continuous testing on Windows. Thanks `@pydanny`_.\n* Update link to Perl source implementation. (#9) Thanks `@asmeurer`_ `@pombredanne`_ `@audreyr`_.\n* Handle UnicodeDecodeError in check. (#12) Thanks `@DRMacIver`_.\n* Add very simple Hypothesis based tests. (#13) Thanks `@DRMacIver`_.\n* Use setup to determine requirements and remove redundant requirements.txt. (#14) Thanks `@hackebrot`_.\n* Add documentation status badge to README.rst. (#15) Thanks `@hackebrot`_.\n* Run tox in travis.yml. Add pypy and Python 3.4 to tox environments. (#16) Thanks `@hackebrot`_ `@pydanny`_.\n* Handle LookupError when detecting encoding. (#17) Thanks `@DRMacIver`_.\n\n\n.. _`@pombredanne`: https://github.com/pombredanne\n.. _`@pydanny`: https://github.com/pydanny\n.. _`@asmeurer`: https://github.com/asmeurer\n.. _`@audreyr`: https://github.com/audreyr\n.. _`@DRMacIver`: https://github.com/DRMacIver\n.. _`@hackebrot`: https://github.com/hackebrot\n\n0.3.0 (2014-05-05)\n~~~~~~~~~~~~~~~~~~\n\n* Include tests, docs in source package. (#6) Thanks `@vincentbernat`_.\n* Drop unnecessary shebangs and executable bits. (#8) Thanks `@scop`_.\n* Generate string of printable extended ASCII bytes only once. (#7) Thanks `@scop`_.\n* Make number of bytes to read parametrizable. (#7) Thanks `@scop`_.\n\n.. _`@vincentbernat`: https://github.com/vincentbernat\n.. _`@scop`: https://github.com/scop\n\n0.2.0 (2013-09-22)\n~~~~~~~~~~~~~~~~~~\n\n* Complete rewrite of everything. Thanks `@ncoghlan`_.\n\n.. _`@ncoghlan`: https://github.com/ncoghlan\n\n0.1.1 (2013-08-17)\n~~~~~~~~~~~~~~~~~~\n\n* Tests pass under Python 2.6, 2.7, 3.3, PyPy.\n\n\n0.1.0 (2013-08-17)\n~~~~~~~~~~~~~~~~~~\n\n* First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/audreyr/binaryornot", "keywords": "binaryornot", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "binaryornot", "package_url": "https://pypi.org/project/binaryornot/", "platform": "", "project_url": "https://pypi.org/project/binaryornot/", "project_urls": { "Homepage": "https://github.com/audreyr/binaryornot" }, "release_url": "https://pypi.org/project/binaryornot/0.4.4/", "requires_dist": null, "requires_python": "", "summary": "Ultra-lightweight pure Python package to check if a file is binary or text.", "version": "0.4.4" }, "last_serial": 3070153, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "be155515056208684631d67c5b43b068", "sha256": "aaba23c42ca3a49042579c348fff97c600773d009a2f101ed550c87608c82d6c" }, "downloads": -1, "filename": "binaryornot-0.1.0.tar.gz", "has_sig": false, "md5_digest": "be155515056208684631d67c5b43b068", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4635, "upload_time": "2013-08-17T00:27:29", "url": "https://files.pythonhosted.org/packages/f8/00/b31226abcd233f05755e48a1b9c7c3c8e677c154f0025968a623cb134ac9/binaryornot-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1b13516f261af573c76f98503cdeb8a2", "sha256": "576ccf315dd342b2b24a4a3d8367e43cd6a19c0ece226dc6e9d9f54e5602253b" }, "downloads": -1, "filename": "binaryornot-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1b13516f261af573c76f98503cdeb8a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4900, "upload_time": "2013-08-17T10:16:29", "url": "https://files.pythonhosted.org/packages/04/fc/4186332d45e3905fbc04ac835b9b2bdb2a8791993f8ed30ff02a7cc37be7/binaryornot-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ecbb411e281f3d922112c5d91f575e06", "sha256": "efae90facfcffc9141e2128d1e378132356d969ce46518c8ff3983cce9846fcc" }, "downloads": -1, "filename": "binaryornot-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ecbb411e281f3d922112c5d91f575e06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5912, "upload_time": "2013-09-22T16:12:14", "url": "https://files.pythonhosted.org/packages/e4/96/e1315c402347ea734bcce81fc7293816288cc9bf0ad226d195a05cc06962/binaryornot-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "8f5bdbeb5ca31075582b42fdf4ce28f5", "sha256": "83bc656b147983da8755c7b1e1323825d29a318ee437f91d210b16b1ec8bacf4" }, "downloads": -1, "filename": "binaryornot-0.3.0.tar.gz", "has_sig": false, "md5_digest": "8f5bdbeb5ca31075582b42fdf4ce28f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 217587, "upload_time": "2014-05-05T11:35:27", "url": "https://files.pythonhosted.org/packages/da/6a/fe777cc15ac20312877418277e161ee9df2dadef1341107dd3337d98025a/binaryornot-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "e85c8ce517c17e577ef178546abaa00e", "sha256": "4c8326ceb3727f4ff7011d7f61b7bca15cca194e2288013a73d5ccaf56d3a18b" }, "downloads": -1, "filename": "binaryornot-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e85c8ce517c17e577ef178546abaa00e", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 8235, "upload_time": "2015-08-22T05:37:00", "url": "https://files.pythonhosted.org/packages/be/22/911b13222e10d32b3d5c92302b7fe017854ed98e6fdb62bc1ecbd2546e79/binaryornot-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aa08df1c8cc72a8e7e2e952479ca6d4c", "sha256": "ab0f387b28912ac9c300db843461359e2773da3b922ae378ab69b0d85b288ec8" }, "downloads": -1, "filename": "binaryornot-0.4.0.tar.gz", "has_sig": false, "md5_digest": "aa08df1c8cc72a8e7e2e952479ca6d4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 370296, "upload_time": "2015-08-22T05:36:29", "url": "https://files.pythonhosted.org/packages/52/69/9ca055b887ccc841fa2d0265aa2599c9d63bc57d3d421dfcda874e0ad3ef/binaryornot-0.4.0.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "c7088557fd0af3683aa9cf7443e22c93", "sha256": "b2ec5159b049f7cc99fd212a2bb1c6b52df3faf9379d8f2048aea0bf22cecb9f" }, "downloads": -1, "filename": "binaryornot-0.4.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c7088557fd0af3683aa9cf7443e22c93", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8820, "upload_time": "2017-04-12T17:55:49", "url": "https://files.pythonhosted.org/packages/85/73/7fd9218da66e41bf62444dfaffd9aac7a4eaa2cf805a0170cd5e3a228382/binaryornot-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "98fd6f68433a453d8513c5230c4fa17f", "sha256": "055c7515ec18e55491c74cdf99b67945d235ca91afb65614128e6d37fee66d1d" }, "downloads": -1, "filename": "binaryornot-0.4.2.tar.gz", "has_sig": false, "md5_digest": "98fd6f68433a453d8513c5230c4fa17f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 370781, "upload_time": "2017-04-12T17:55:46", "url": "https://files.pythonhosted.org/packages/a3/fc/79c9a88d1a56d93fbf4851c933ed9ab5c96a00f3ad8e5e3f12aa99d5df82/binaryornot-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "5aa2f00bbbcce5d2b6a1c9cd052c0651", "sha256": "475318ab4983dc1746b788c6cdf4399fef23bcd624eb2800b402f508dbe5a7dd" }, "downloads": -1, "filename": "binaryornot-0.4.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5aa2f00bbbcce5d2b6a1c9cd052c0651", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8909, "upload_time": "2017-04-12T19:57:37", "url": "https://files.pythonhosted.org/packages/58/30/c817b7f213f09f4b9e049061283d56875636d26d64d62ee626f06c862f72/binaryornot-0.4.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "699b3a816b7078e3b59dbf90ba95ea7c", "sha256": "d359566c1744526be6ea47e56bbc6f506a76cabdd49c09f6847520594f1b309e" }, "downloads": -1, "filename": "binaryornot-0.4.3.tar.gz", "has_sig": false, "md5_digest": "699b3a816b7078e3b59dbf90ba95ea7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 370883, "upload_time": "2017-04-12T19:57:34", "url": "https://files.pythonhosted.org/packages/12/00/cc37b0a1eea6eefcb4574036a74fde3ea9f45d302d5f2eee7b67c832ceb9/binaryornot-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "7a69d00f3c384693c9616c3381c411a3", "sha256": "b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4" }, "downloads": -1, "filename": "binaryornot-0.4.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7a69d00f3c384693c9616c3381c411a3", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9006, "upload_time": "2017-08-03T15:55:31", "url": "https://files.pythonhosted.org/packages/24/7e/f7b6f453e6481d1e233540262ccbfcf89adcd43606f44a028d7f5fae5eb2/binaryornot-0.4.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09c0b7f5f3f7c881e2f306780eac7128", "sha256": "359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061" }, "downloads": -1, "filename": "binaryornot-0.4.4.tar.gz", "has_sig": false, "md5_digest": "09c0b7f5f3f7c881e2f306780eac7128", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 371054, "upload_time": "2017-08-03T15:55:25", "url": "https://files.pythonhosted.org/packages/a7/fe/7ebfec74d49f97fc55cd38240c7a7d08134002b1e14be8c3897c0dd5e49b/binaryornot-0.4.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7a69d00f3c384693c9616c3381c411a3", "sha256": "b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4" }, "downloads": -1, "filename": "binaryornot-0.4.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7a69d00f3c384693c9616c3381c411a3", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9006, "upload_time": "2017-08-03T15:55:31", "url": "https://files.pythonhosted.org/packages/24/7e/f7b6f453e6481d1e233540262ccbfcf89adcd43606f44a028d7f5fae5eb2/binaryornot-0.4.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09c0b7f5f3f7c881e2f306780eac7128", "sha256": "359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061" }, "downloads": -1, "filename": "binaryornot-0.4.4.tar.gz", "has_sig": false, "md5_digest": "09c0b7f5f3f7c881e2f306780eac7128", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 371054, "upload_time": "2017-08-03T15:55:25", "url": "https://files.pythonhosted.org/packages/a7/fe/7ebfec74d49f97fc55cd38240c7a7d08134002b1e14be8c3897c0dd5e49b/binaryornot-0.4.4.tar.gz" } ] }