1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
============
Enum Tools
============
.. start short_desc
.. documentation-summary::
:meta:
.. end short_desc
.. .. code-block:: python
.. class Tools(Enum):
Hammer = "🔨"
Spanner = "🔧"
Scissors = "✂️"
.. start shields
.. only:: html
.. list-table::
:stub-columns: 1
:widths: 10 90
* - Docs
- |docs| |docs_check|
* - Tests
- |actions_linux| |actions_windows| |actions_macos| |coveralls|
* - PyPI
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
* - Anaconda
- |conda-version| |conda-platform|
* - Activity
- |commits-latest| |commits-since| |maintained| |pypi-downloads|
* - QA
- |codefactor| |actions_flake8| |actions_mypy|
* - Other
- |license| |language| |requires|
.. |docs| rtfd-shield::
:project: enum-tools
:alt: Documentation Build Status
.. |docs_check| actions-shield::
:workflow: Docs Check
:alt: Docs Check Status
.. |actions_linux| actions-shield::
:workflow: Linux
:alt: Linux Test Status
.. |actions_windows| actions-shield::
:workflow: Windows
:alt: Windows Test Status
.. |actions_macos| actions-shield::
:workflow: macOS
:alt: macOS Test Status
.. |actions_flake8| actions-shield::
:workflow: Flake8
:alt: Flake8 Status
.. |actions_mypy| actions-shield::
:workflow: mypy
:alt: mypy status
.. |requires| image:: https://dependency-dash.repo-helper.uk/github/domdfcoding/enum_tools/badge.svg
:target: https://dependency-dash.repo-helper.uk/github/domdfcoding/enum_tools/
:alt: Requirements Status
.. |coveralls| coveralls-shield::
:alt: Coverage
.. |codefactor| codefactor-shield::
:alt: CodeFactor Grade
.. |pypi-version| pypi-shield::
:project: enum_tools
:version:
:alt: PyPI - Package Version
.. |supported-versions| pypi-shield::
:project: enum_tools
:py-versions:
:alt: PyPI - Supported Python Versions
.. |supported-implementations| pypi-shield::
:project: enum_tools
:implementations:
:alt: PyPI - Supported Implementations
.. |wheel| pypi-shield::
:project: enum_tools
:wheel:
:alt: PyPI - Wheel
.. |conda-version| image:: https://img.shields.io/conda/v/conda-forge/enum_tools?logo=anaconda
:target: https://anaconda.org/conda-forge/enum_tools
:alt: Conda - Package Version
.. |conda-platform| image:: https://img.shields.io/conda/pn/conda-forge/enum_tools?label=conda%7Cplatform
:target: https://anaconda.org/conda-forge/enum_tools
:alt: Conda - Platform
.. |license| github-shield::
:license:
:alt: License
.. |language| github-shield::
:top-language:
:alt: GitHub top language
.. |commits-since| github-shield::
:commits-since: v0.12.0
:alt: GitHub commits since tagged version
.. |commits-latest| github-shield::
:last-commit:
:alt: GitHub last commit
.. |maintained| maintained-shield:: 2024
:alt: Maintenance
.. |pypi-downloads| pypi-shield::
:project: enum_tools
:downloads: month
:alt: PyPI - Downloads
.. end shields
Overview
------------
.. latex-section::
This library provides the following:
#. :mod:`enum_tools.autoenum` -- A `Sphinx <https://www.sphinx-doc.org>`_ extension to document Enums better than :rst:dir:`autoclass`
can currently.
#. :deco:`enum_tools.documentation.document_enum` -- A decorator to add docstrings to :class:`~enum.Enum` members
from a comment at the end of the line.
#. :mod:`enum_tools.custom_enums` -- Additional :class:`~enum.Enum` classes with different functionality.
Installation
--------------
.. start installation
.. installation:: enum_tools
:pypi:
:github:
:anaconda:
:conda-channels: conda-forge
.. end installation
Contents
------------
.. html-section::
.. toctree::
:hidden:
Home<self>
.. toctree::
:maxdepth: 3
:glob:
api/*
.. only:: html
.. toctree::
:maxdepth: 3
:glob:
contributing
Source
license
.. sidebar-links::
:caption: Links
:github:
:pypi: enum_tools
.. start links
.. only:: html
View the :ref:`Function Index <genindex>` or browse the `Source Code <_modules/index.html>`__.
:github:repo:`Browse the GitHub Repository <domdfcoding/enum_tools>`
Further Reading
-----------------------
.. html-section::
.. only:: html
* https://docs.python.org/3/library/enum.html
* `Is it possible to define a class constant inside an Enum? <https://stackoverflow.com/q/17911188/3092681>`_
* `Enums with Attributes <https://stackoverflow.com/a/19300424/3092681>`_
* `When should I subclass EnumMeta instead of Enum? <https://stackoverflow.com/a/43730306/3092681>`_
|