{"id":23133,"library":"nostril-detector","title":"Nostril","description":"Nostril (Nonsense String Evaluator) is a Python 3 module that infers whether a given word or text string is likely nonsense or meaningful text. It is primarily used to distinguish program identifiers from natural language. Current version 1.2.2, released 2023-12-31. Release cadence is low, with no recent updates.","status":"active","version":"1.2.2","language":"python","source_language":"en","source_url":"https://github.com/casics/nostril","tags":["nonsense","text-classification","natural-language-processing","program-identifier"],"install":[{"cmd":"pip install nostril-detector","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Required for array operations","package":"numpy","optional":false},{"reason":"Required for the naive Bayes classifier","package":"scikit-learn","optional":false}],"imports":[{"note":"The package name on PyPI is nostril-detector, but the import module is nostril.","wrong":"from nostril_detector import detect_nonsense","symbol":"detect_nonsense","correct":"from nostril import detect_nonsense"},{"note":"","wrong":"","symbol":"Nostril","correct":"from nostril import Nostril"}],"quickstart":{"code":"from nostril import detect_nonsense\n\n# Test a meaningful string\ntest_string = 'hello world'\nresult = detect_nonsense(test_string)\nprint(f'{test_string!r}: nonsense={result}')\n\n# Test a nonsense string (e.g., program identifier)\ntest_string2 = 'xzyqwk'\nresult2 = detect_nonsense(test_string2)\nprint(f'{test_string2!r}: nonsense={result2}')\n","lang":"python","description":"Basic usage: call detect_nonsense(string) which returns True if the string is likely nonsense, False otherwise."},"warnings":[{"fix":"Use 'from nostril import detect_nonsense' after 'pip install nostril-detector'.","message":"The import module is 'nostril', not 'nostril_detector'. Uninstalling 'nostril-detector' and installing 'nostril' leads to a different package (a text encoding detector).","severity":"gotcha","affected_versions":"all"},{"fix":"Remember: detect_nonsense('hello') -> False (meaningful); detect_nonsense('xzy') -> True (nonsense).","message":"The detect_nonsense function returns True for nonsense input and False for meaningful input. This is contrary to intuition (non-nonsense = meaningful).","severity":"gotcha","affected_versions":"all"},{"fix":"Use '-V' for version, or '--version'.","message":"The command-line option '-v' for version was changed to '-V' in v1.1.0.","severity":"deprecated","affected_versions":"<1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from nostril import detect_nonsense'. The package name and import module differ.","cause":"You pip installed 'nostril-detector' but tried to import 'nostril_detector' or another name.","error":"ModuleNotFoundError: No module named 'nostril'"},{"fix":"Uninstall 'nostril' if installed, then 'pip install nostril-detector'.","cause":"Outdated version or wrong pip package. The package 'nostril' on PyPI is a different library (text encoding detector).","error":"ImportError: cannot import name 'detect_nonsense' from 'nostril'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}