# AutoStrEnum
Project description
AutoStrEnum
This project defines an extended Enum
class.
It can automatically assign the value to your Enum member, and the value is just the same as the member name!
And when you print it, you won't see the Enum name in front of the class member.
Install
pip install AutoStrEnum
Basic use
from enum import auto
from AutoStrEnum import AutoStrEnum
class Fruit(AutoStrEnum):
BANANA = auto()
WATERMELON = auto()
DURIAN = auto()
if __name__ == '__main__':
print(Fruit.BANANA, Fruit.WATERMELON, Fruit.DURIAN)
$ python demo.py
BANANA WATERMELON DURIAN
You can check all the example at demo.py
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
AutoStrEnum-0.0.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for AutoStrEnum-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e055ad48be2c830b066b635f87ba79f117d63660e7843a4467a7c03307476bf0 |
|
MD5 | 3df90aae339e545ffd4e9ab361fe4b1f |
|
BLAKE2b-256 | 96f16a38f90919e7e1d9552d10d178014cd87264d0e8865cee2cc46ba7dba686 |