skillfed

exitstatus

POSIX exit status codes

exitstatus v2.7.0 293.7K downloads/30d#7,951 on PyPI9
Permissive license MIT Active released

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 exitstatus

uv

uv add exitstatus

poetry

poetry add exitstatus

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

POSIX exit codesexit status constantsportable exit codessys.exit codesexit code enumstandard exit statusescross-platform exit codes
cli-toolsposix-standard

More Utilities packages