{"id":27877,"library":"isbinary","title":"IsBinary","description":"A lightweight pure Python package to check if a file is binary or text (fork of binaryornot). Current version 1.0.1, released April 2023. Uses heuristic scanning of a configurable chunk of bytes.","status":"active","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/djmattyg007/python-isbinary","tags":["binary","file-type","text-detection","pure-python"],"install":[{"cmd":"pip install isbinary","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Old import from the original binaryornot library; v1.0.0 broke compatibility and renamed the function.","wrong":"from binaryornot.check import is_binary","symbol":"is_binary_file","correct":"from isbinary import is_binary_file"}],"quickstart":{"code":"from isbinary import is_binary_file\n\nresult = is_binary_file('path/to/file')\nprint(result)  # True if binary, False if text\n\n# Or via CLI: python -m isbinary path/to/file","lang":"python","description":"Basic usage to detect binary vs text file."},"warnings":[{"fix":"Replace `from binaryornot.check import is_binary` with `from isbinary import is_binary_file`.","message":"In v1.0.0 the package name changed from binaryornot to isbinary. All imports must be updated.","severity":"breaking","affected_versions":"≥1.0.0"},{"fix":"Change all calls from `is_binary(path)` to `is_binary_file(path)`.","message":"The function name changed from `is_binary` to `is_binary_file` in v1.0.0.","severity":"breaking","affected_versions":"≥1.0.0"},{"fix":"If needed, adjust chunk size with the `chunk_size` parameter: `is_binary_file(path, chunk_size=1024)`.","message":"The default chunk size increased from 1024 to 2048 bytes. This may affect detection of very small files or performance.","severity":"gotcha","affected_versions":"≥1.0.0"},{"fix":"Ensure you run on Python 3.8 or later.","message":"Python 2 support was removed. Only Python 3.8+ is supported.","severity":"gotcha","affected_versions":"≥1.0.0"}],"env_vars":null,"search_vec":"'1.0.1':21 '2023':24 'april':23 'binari':13,34 'binaryornot':18 'byte':33 'check':8 'chunk':31 'configur':30 'current':19 'detect':40 'file':11,36 'file-typ':35 'fork':16 'heurist':26 'isbinari':1 'lightweight':3 'packag':6 'pure':4,42 'pure-python':41 'python':5,43 'releas':22 'scan':27 'text':15,39 'text-detect':38 'type':37 'use':25 'version':20","created_at":"2026-05-09T05:52:32.985327+00:00","updated_at":"2026-05-09T05:52:32.985327+00:00","problems":[{"fix":"Install isbinary and update imports: `from isbinary import is_binary_file`.","cause":"The old package binaryornot is replaced by isbinary.","error":"ModuleNotFoundError: No module named 'binaryornot'"},{"fix":"Use `from isbinary import is_binary_file`.","cause":"The package was renamed; import path is different.","error":"AttributeError: module 'binaryornot.check' has no attribute 'is_binary'"},{"fix":"Use `from isbinary import is_binary_file` and call `is_binary_file(path)`.","cause":"Function was renamed from is_binary to is_binary_file in v1.0.0.","error":"ImportError: cannot import name 'is_binary' from 'isbinary'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/djmattyg007/python-isbinary","docs":"https://isbinary.readthedocs.io/","changelog":null,"pypi":"https://pypi.org/project/isbinary/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}