Skip to main content

Decorator to automatically create Enum with filled values

Project description


GitHub license PyPI Version

This Decorator returns an Enum, which contains all values in values.

Values, which the passed class not include, will be auto generated with prefix + value as name if they are in the values list.

Args: values: An iterable list of values for the Enum members. enum_cls: The Enum class or a subclass of it. prefix: The prefix for the name of the auto generated Enum members. *args: Will be passed to the enum_cls constructor. **kwargs: Will be passed to the enum_cls constructor.

Gitlab Snippet

Original Blog Post

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fill_enum, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size fill_enum-0.1.0.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View
Filename, size fill_enum-0.1.0-py2.py3-none-any.whl (3.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page