skillfed

enum-tools

Tools to expand Python's enum module.

enum-tools v0.13.0 1.4M downloads/30d#3,949 on PyPI11
Copyleft license LGPL-3.0-or-later Active released

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 on this page — 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

enum-tools on PyPI

pip

pip install enum-tools

uv

uv add enum-tools

poetry

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 the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — pygments, typing-extensions
Maintenance actively maintained — 484 days since the last release
Last repo commit
First released
Downloads 1,401,832/month — #3,949 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: enum_tools-0.13.0-py3-none-any.whl

Keywords: documentation, enum, sphinx, sphinx-extension

Development Status :: 4 - BetaFramework :: Sphinx :: ExtensionIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: DocumentationTopic :: Documentation :: SphinxTopic :: Software Development :: DocumentationTopic :: Software Development :: Libraries :: Python ModulesTopic :: UtilitiesTyping :: Typed

Tags

enum documentation sphinxpython enum toolsenum member docstringscustom enum classesenum sphinx extensionpython enum utilitiesdocument enum members
enum-utilitiessphinx-extensiondocumentation-generation

More Python Modules packages