--- id: strenum version: "0.4.15" license: unclear license_treatment: permissive maintenance: dormant --- # StrEnum — An Enum that inherits from str. License: permissive · Maintenance: dormant · Popularity: top 1,000 on PyPI ## Install pip install strenum uv add strenum poetry add strenum ## Description # StrEnum [![Build Status](https://github.com/irgeek/StrEnum/workflows/Python%20package/badge.svg)](https://github.com/irgeek/StrEnum/actions) StrEnum is a Python `enum.Enum` that inherits from `str` to complement `enum.IntEnum` in the standard library. Supports python 3.7+. ## Installation You can use [pip](https://pip.pypa.io/en/stable/) to install. ```bash pip install StrEnum ``` ## Usage ```python from enum import auto from strenum import StrEnum class HttpMethod(StrEnum): GET = auto() HEAD = auto() POST = auto() PUT = auto() DELETE = auto() CONNECT = auto() OPTIONS = auto() TRACE = auto() PATCH = auto() assert HttpMethod.GET == "GET" # You can use StrEnum values just like strings: import urllib.request req = urllib.request.Request('https://www.python.org/', method=HttpMethod.HEAD) with urllib.request.urlopen(req) as response: html = response.read() assert len(html) == 0 # HEAD requests do not (usually) include a body ``` There are classes whose `auto()` value folds each member name to upper or lower case: ```python from enum import auto from strenum import LowercaseStrEnum, UppercaseStrEnum class... ## AI interpretation — verify before relying StrEnum provides an Enum subclass that inherits from str, allowing enum members to be used directly as strings with automatic case conversion options (uppercase, lowercase, camelCase, snake_case, kebab-case, PascalCase, MACRO_CASE) via auto(). Verdict: StrEnum is a stable, dependency-free utility for creating string-based enums with optional automatic case conversion. It fills a real gap for Python < 3.11 (where enum.StrEnum was added to the standard library), but its dormant maintenance status and lack of recent updates mean it may not receive bug fixes or compatibility patches for newer Python versions. Suitable for projects that need string enums and can tolerate no active development. [View on SkillFed](https://skillfed.io/packages/strenum) · [View on PyPI](https://pypi.org/project/strenum/)