Description
Detect whether a file appears to be binary or text from Python code with a small pure-Python helper. It helps tools decide how to display, scan, or process files safely.
Binary-or-text detection is heuristic and can be wrong for unusual encodings or mixed files. Avoid using it as the only safety check before parsing untrusted content.