The repository or configuration that created this release differ from a previous release. View details.
sphinxcontrib-enum
Sphinx directive for documenting dataclass enums in tabular format, with support for enum-properties.
Render dataclass enums as tables with a row for each member and a column for every field. Tables can optionally offer CSV and JSON download buttons. Enums with dataclass values, named tuple values and plain enums work too, and enum-properties enums are also supported!
Installation
pip install sphinxcontrib-enum
To document enum-properties enums, install the properties extra to get a supported version of enum-properties:
pip install "sphinxcontrib-enum[properties]"
Add the extension to your conf.py:
extensions = [
...
"sphinxcontrib_enum",
]
Quick Start
Dataclass Enums
Each dataclass field becomes a column. Field docstrings can describe the columns in an optional legend:
from dataclasses import dataclass
from enum import Enum
@dataclass(frozen=True)
class PlanetData:
mass: float
"""Mass in kilograms."""
radius: float
"""Radius in meters."""
#: Number of known moons.
moons: int
class Planet(PlanetData, Enum):
MERCURY = 3.303e23, 2.4397e6, 0
VENUS = 4.869e24, 6.0518e6, 0
EARTH = 5.976e24, 6.37814e6, 1
MARS = 6.421e23, 3.3972e6, 2
.. enum-table:: mypackage.Planet
:legend:
:download:
Member Docstrings
Member docstrings are rendered in a doc column. They are parsed as reStructuredText:
from enum import IntEnum
class Severity(IntEnum):
DEBUG = 10
"""Diagnostic detail, usually disabled in production."""
INFO = 20
"""Routine operational messages."""
#: Something unexpected happened that the application **recovered** from.
WARNING = 30
ERROR = 40
"""A failure that needs attention.
See :ref:`usage` for how to render these tables."""
CRITICAL = 50
.. enum-table:: mypackage.Severity
:download:
enum-properties
enum-properties properties become columns, described by their annotation docstrings:
import typing as t
from enum_properties import EnumProperties, Symmetric
class Shade(EnumProperties):
label: t.Annotated[str, Symmetric()]
"""A human readable label."""
hex: t.Annotated[str, Symmetric(case_fold=True)]
"""The hex color code, without a leading ``#``."""
RED = 1, "Red", "ff0000"
GREEN = 2, "Green", "00ff00"
BLUE = 3, "Blue", "0000ff"
.. enum-table:: mypackage.Shade
:legend:
:download:
Columns, members, headers, widths, captions, download formats and cell formatting can all be customized:
.. enum-table:: mypackage.Planet
:columns: name, radius
:members: EARTH, MERCURY
:headers: name=Planet, radius=Radius (m)
:caption: The inner planets.
Documentation
Full documentation is available at sphinxcontrib-enum.readthedocs.io.
Development
git clone https://github.com/sphinx-contrib/enum.git
cd sphinxcontrib-enum
just setup
just install
just test
Contributing
Contributions are welcome! Please see CONTRIBUTING.md.
Metadata
Release files for sphinxcontrib-enum 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Change of provenance
The repository or configuration that created these release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sphinxcontrib_enum-0.3.1.tar.gz | 535.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinxcontrib_enum-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 554.6 kB
Release files / sphinxcontrib_enum-0.3.1.tar.gz
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | sphinxcontrib_enum-0.3.1.tar.gz |
|---|---|
| Size | 535.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bceb905864056525770cc66fd34d63470446c301261fc614ca3ab16401aec387
|
|
BLAKE2b-256 checksum How to use checksums |
3b582232533b2c2d80f08e5ac1e440932a9bcbf3c2f6578a22bceb2780bfebcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / sphinxcontrib_enum-0.3.1-py3-none-any.whl
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | sphinxcontrib_enum-0.3.1-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5d43ec5fcc64524e6d049000a41b2ddfe6ed0e1937b440e72b49cb2a2fc9280
|
|
BLAKE2b-256 checksum How to use checksums |
1eb9433e05508ec3133ac1270da8283e8d6559a5727643975a573a4563ca1bbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logSecurity for sphinxcontrib-enum 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Change of provenance
The repository that created this release differs from a previous release.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Repository
- Removed 0.3.0 GitHub: bckohan/sphinxcontrib-enum
- Added 0.3.1 GitHub: sphinx-contrib/enum
Attestation for sphinxcontrib_enum-0.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.