{"id":21316,"library":"exit-codes","title":"exit-codes","description":"Platform-independent exit codes for Python. Provides a comprehensive mapping of standardized exit codes (e.g., EX_OK, EX_USAGE, EX_SOFTWARE) based on POSIX and common system conventions. Current version 1.3.0; stable with infrequent releases.","status":"active","version":"1.3.0","language":"python","source_language":"en","source_url":"https://github.com/sixty-north/exit-codes","tags":["exit codes","sys.exit","platform-independent"],"install":[{"cmd":"pip install exit-codes","lang":"bash","label":"Install"}],"dependencies":[],"imports":[{"note":"All exit code constants are attributes of the module; direct import of individual constants may cause confusion as they are not nested.","wrong":"from exit_codes import EX_OK","symbol":"EX_OK","correct":"import exit_codes\nprint(exit_codes.EX_OK)"}],"quickstart":{"code":"import sys\nimport exit_codes\n\nsys.exit(exit_codes.EX_USAGE)  # exits with code 64","lang":"python","description":"Use exit codes from the module for platform-independent script exits."},"warnings":[{"fix":"If you need reverse lookup, maintain your own mapping.","message":"The library does not provide reverse lookups (e.g., getting name from code). All exit codes are integer constants.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use `import exit_codes` in code.","message":"The module name uses a hyphen in PyPI but an underscore in Python: `import exit_codes` (not `exit-codes`).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check if the constant exists before using via `hasattr(exit_codes, 'EX_TEMPFAIL')`.","message":"Some constants like EX_TEMPFAIL are defined but may be platform-specific and not always available.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `import exit_codes` (with underscore).","cause":"Trying to import using the PyPI name with hyphen instead of underscore.","error":"ModuleNotFoundError: No module named 'exit-codes'"},{"fix":"Run `pip install --upgrade exit-codes` and check the installed version.","cause":"Perhaps the library is not installed or an older version without that constant.","error":"AttributeError: module 'exit_codes' has no attribute 'EX_OK'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}