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. Each table has CSV and JSON download buttons. Enums with dataclass values, named tuple values and plain enums work too, and enum-properties enums are supported as a special case: each property becomes a column.
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
Given a dataclass enum:
from dataclasses import dataclass
from enum import Enum
@dataclass(frozen=True)
class PlanetData:
mass: float
radius: float
class Planet(PlanetData, Enum):
MERCURY = 3.303e23, 2.4397e6
VENUS = 4.869e24, 6.0518e6
EARTH = 5.976e24, 6.37814e6
Document it with:
.. enum-table:: mypackage.Planet
:caption: The inner planets.
Which renders a table with name, mass and radius columns. Columns, members, headers, widths, 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)
:download: csv
Documentation
Full documentation is available at sphinxcontrib-enum.readthedocs.io.
Development
git clone https://github.com/bckohan/sphinxcontrib-enum.git
cd sphinxcontrib-enum
just setup
just install
just test
Contributing
Contributions are welcome! Please see CONTRIBUTING.md.
Release files for sphinxcontrib-enum 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sphinxcontrib_enum-0.1.0.tar.gz | 146.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinxcontrib_enum-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 160.3 kB
Release files / sphinxcontrib_enum-0.1.0.tar.gz
| Download URL | sphinxcontrib_enum-0.1.0.tar.gz |
|---|---|
| Size | 146.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d096c447e30fb5f60678b58bec85db9af9e296b26703e124fd9fd122c0a4aa3e
|
|
BLAKE2b-256 checksum How to use checksums |
e4a5434621fa56d6b4593bc1118cf1d8358c5e8c3c351c40fa3bb8e35d06f2e4
|
| 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 Sep 28, 2026.
Transparency logRelease files / sphinxcontrib_enum-0.1.0-py3-none-any.whl
| Download URL | sphinxcontrib_enum-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e43bf8cded602ba0011f8a9115471d5c9a14fc01e5cde93935453a5720b3ed8
|
|
BLAKE2b-256 checksum How to use checksums |
7c05c56524985f8393e9006ef7a058005c61320a81a19669f88582cf2edcbce9
|
| 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 Sep 28, 2026.
Transparency log