{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/11"}],"enrichment":{"capability":"Determines whether a file is binary or text by analyzing its content using a heuristic similar to Perl's file-type detection, relying on chardet for encoding analysis.","skillfed_tags":["file-detection","unmaintained"],"use_cases":["Filter files in a directory walk to process only text files, skipping binaries like images or compiled objects.","Validate user-uploaded files in a web application to reject binary uploads when only text is expected.","Preprocess data pipelines to separate text and binary files for different downstream handlers.","Build development tools that need to distinguish text source files from binary artifacts in a repository.","Implement file-type guards in backup or sync utilities to handle text and binary files differently."],"what_it_does":"isbinary is a lightweight pure-Python library that guesses whether a file is binary or text by examining its content using a heuristic based on Perl's pp_fttext algorithm. It uses chardet for encoding detection and has been tested against common file types (.txt, .json, .png, .jpg, etc.) and multiple encodings. The package was forked from the abandoned binaryornot project in May 2022 to add type annotations, modernize CI tooling, and drop Python 2 support.\n\nThe library solves a deceptively complex problem: naive approaches like checking for null bytes or trying to decode as UTF-8 fail on real-world files. isbinary encapsulates a battle-tested heuristic that handles edge cases across different platforms and file encodings, saving you from writing and thoroughly testing this logic yourself. However, the package itself is now abandoned\u2014no updates since its initial release\u2014so it will not receive bug fixes or support for newly discovered edge cases.","worth_installing":"Yes, if you need reliable binary/text detection and can accept that the package is unmaintained. It has no known vulnerabilities, low install friction, and solves a genuine problem with a proven heuristic. However, do not install if you require ongoing maintenance, support for edge cases discovered after May 2022, or compatibility with Python versions beyond 3.10\u2014the last commit was over three years ago."},"id":"isbinary","links":{"html":"https://skillfed.io/packages/isbinary","md":"https://skillfed.io/packages/isbinary.md","pypi":"https://pypi.org/project/isbinary/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2022-05-22","license_spdx":null,"license_treatment":"permissive","name":"isbinary","python_support":"supports_current","summary":"Lightweight pure Python package to check if a file is binary or text."},"popularity":{"monthly_downloads":76900,"position":14582,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.0.1"}
