Enum with to_dict method.
Project description
EnumWithDict
EnumWithDict
is a Python package that extends the standard library's Enum
class to include to_dict
and get_initial
class methods. This enhancement allows for straightforward conversion of enum classes to dictionaries and provides easy access to the initial enum value, facilitating a more versatile use of enumerations in Python applications.
Features
- to_dict: Convert an enum class to a dictionary representation, mapping member names to their values.
- get_initial: Retrieve the first value defined in the enum, useful for cases where a default or initial value is needed.
Installation
Install EnumWithDict
using pip:
pip install enum_with_dict
LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
enum_with_dict-0.1.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for enum_with_dict-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b96130ae8bf726b955bf67492f5d57fa019a6d088a3aada1c8ef3a3ed71eda4 |
|
MD5 | 608aef73910f24e0d11b1418a7d75068 |
|
BLAKE2b-256 | 0b070143609a01d2d8bd1dee0ee02b153dd49506b64b8eacb7375097f1a3ab83 |