# 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file AutoStrEnum-0.0.1.tar.gz.
File metadata
- Download URL: AutoStrEnum-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
167102d4123e306d334f49bb6d3e2c5217a2b8e33fa18c64a5b8c61a524511f1
|
|
| MD5 |
f03ded566d21f9489cb7b791b92a60f4
|
|
| BLAKE2b-256 |
98a2984cbce6d6f50ae77e05a06f8174b8aa615bf1ae710d878c0cd9b6010634
|
File details
Details for the file AutoStrEnum-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: AutoStrEnum-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e055ad48be2c830b066b635f87ba79f117d63660e7843a4467a7c03307476bf0
|
|
| MD5 |
3df90aae339e545ffd4e9ab361fe4b1f
|
|
| BLAKE2b-256 |
96f16a38f90919e7e1d9552d10d178014cd87264d0e8865cee2cc46ba7dba686
|