--- id: enum-tools version: "0.13.0" license: LGPL-3.0-or-later license_treatment: copyleft maintenance: active --- # enum-tools — Tools to expand Python's enum module. License: copyleft · Maintenance: active · Downloads: 1.4M/mo ## What it is and what it does enum_tools extends Python's standard enum module with three main components: a Sphinx extension (autoenum) that documents enums more effectively than the default autoclass directive, a decorator (@document_enum) that extracts docstrings for enum members from inline comments, and custom enum classes with additional functionality. The package is primarily useful for projects that use enums extensively and need better documentation generation or want to attach metadata to enum members without boilerplate. It depends on pygments for syntax highlighting and typing-extensions for type hints, both lightweight and widely available. The package supports Python 3.7 through 3.13 and is actively maintained. It's particularly relevant for library authors and projects with complex enum hierarchies that need clear, auto-generated documentation. Use it for: - Generate Sphinx documentation for enum classes automatically with better formatting than the default autoclass directive. - Add descriptive docstrings to individual enum members using inline comments with the @document_enum decorator. - Build custom enum subclasses with extended behavior beyond the standard Enum class for domain-specific use cases. - Maintain enum documentation in sync with code by extracting member descriptions from source comments. - Support type-checked enum definitions across Python 3.7+ projects with full typing support. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides utilities to enhance Python's enum module with better Sphinx documentation, member docstrings via decorators, and custom enum classes with extended functionality. Yes, if you use enums in a documented project or need custom enum behavior. The low install friction, active maintenance, and lack of known vulnerabilities make it safe to adopt. The copyleft license (LGPL-3.0-or-later) is a consideration for proprietary code but not a barrier for open-source projects. Install it when Sphinx documentation or member docstrings would improve your codebase clarity. ## Install pip install enum-tools uv add enum-tools poetry add enum-tools ## Installing enum-tools Before you install: Low install friction with only two lightweight runtime dependencies (pygments and typing-extensions). Actively maintained with recent commits and a stable Beta status. License in practice: Licensed under LGPL-3.0-or-later (copyleft). Derivative works and distributions must preserve the license and source availability; suitable for open-source projects but requires careful review in proprietary contexts. Quickstart: pip install enum_tools from enum_tools.documentation import document_enum from enum import Enum @document_enum class Color(Enum): RED = 1 # The color red BLUE = 2 # The color blue Requires Python 3.7 or later; Sphinx extension use requires Sphinx to be installed separately in your documentation build environment. Verify before relying: - Specific capabilities of custom_enums classes and how they differ from standard Enum beyond what the description states. - Whether the Sphinx extension (autoenum) works with all Sphinx versions or has version constraints. - Performance characteristics or limitations when documenting large enum hierarchies. ## Package facts - License: LGPL-3.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags enum documentation sphinx, python enum tools, enum member docstrings, custom enum classes, enum sphinx extension, python enum utilities, document enum members, enum-utilities, sphinx-extension, documentation-generation [View on SkillFed](https://skillfed.io/packages/enum-tools) · [View on PyPI](https://pypi.org/project/enum-tools/)