exitstatus
POSIX exit status codes
What it is and what it does
exitstatus wraps POSIX standard exit codes in a typed IntEnum, making them portable and expressive across platforms. Python's os module provides some Unix-specific exit codes but lacks portability and the generic failure case; exitstatus fills that gap with clean, standard definitions you can pass directly to sys.exit().
The package is minimal and dependency-free, designed for scripts and applications that need to signal completion status to their operating environment. It supports Python 3.10 through 3.14 and is type-checked with mypy, making it suitable for both simple CLI tools and larger applications that care about exit semantics.
Use it for:
- Exit a CLI tool with a standard POSIX code to signal success or specific failure modes to the shell.
- Write cross-platform Python scripts that use portable exit codes instead of platform-specific constants.
- Build type-safe application exit logic where exit codes are defined as named enum members rather than magic integers.
- Integrate exit status handling into test runners or deployment scripts that depend on exit codes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides portable, type-safe POSIX exit status code definitions as an IntEnum for use in Python scripts and applications.
Yes. If you write command-line tools or scripts that need to signal exit status to the operating system, this package eliminates the friction of remembering or looking up POSIX codes. It has no dependencies, is actively maintained, carries a permissive license, and supports current Python versions. The cost of adoption is negligible.
Install
exitstatus on PyPI
pip
pip install exitstatusuv
uv add exitstatuspoetry
poetry add exitstatusInstalling exitstatus
Before you install
Low friction installation with no runtime dependencies. Actively maintained as of 2026-01-01, with recent commits and Production/Stable status.
License in practice
MIT license (permissive) allows use in commercial and open-source projects with minimal restrictions.
Quickstart
import sys
from exitstatus import ExitStatus
sys.exit(ExitStatus.success)
Requires Python 3.10 or later.
Verify before relying
- Whether the package covers all standard POSIX exit codes or a subset of them.
- What specific exit codes are available beyond success (e.g., failure, usage error, etc.).
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 225 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 293,683/month — #7,951 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: exitstatus-2.7.0-py3-none-any.whl
Keywords: exit, status, POSIX
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
exit-codesProvides platform-independent exit codes for…
permissive · top 15,000 on PyPI
pylint-exitTranslates pylint's bit-encoded exit codes into…
permissive · top 15,000 on PyPI
ntstatusProvides Python constants and lookup methods…
permissive · top 15,000 on PyPI
lib-cli-exit-toolsProvides portable signal handling,…
permissive · top 15,000 on PyPI
python-statusProvides named constants for HTTP status codes…
permissive · top 15,000 on PyPI
backports.strenumProvides StrEnum, a string-based enumeration…
permissive · top 5,000 on PyPI
noxNox automates testing across multiple Python…
permissive · top 5,000 on PyPI
cli-exit-toolsHandles proper exit procedures for CLI…
permissive · top 5,000 on PyPI
nox-uvnox-uv replaces nox's standard session…
permissive · top 15,000 on PyPI
aenumaenum provides advanced enumeration types…
permissive · top 1,000 on PyPI