StrEnum
An Enum that inherits from str.
Decision gist · record as of 2026-08-14
Yes, if you need string enums on Python 3.7–3.10 or want the case-conversion variants not available in Python 3.11+'s standard library enum.StrEnum. Low friction, no dependencies, permissive license, and no security issues. Maintenance is dormant but the package is stable and unlikely to need updates. Not necessary if you're on Python 3.11+ and the standard library's StrEnum meets your needs.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Dormant maintenance (last release 2023-06-29, last commit 2024-02-08) but marked Production/Stable and no known vulnerabilities.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute freely with minimal restrictions.
last release 2023-06-29 (1142 days) · last repo commit 2024-02-08 · 123 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 40,286,862 downloads/mo, #683 on PyPI
Alternatives
Verify before relying
pip install StrEnum
from strenum import StrEnum
from enum import auto
class HttpMethod(StrEnum):
GET = auto()
POST = auto()
assert HttpMethod.GET == "GET"
print(HttpMethod.GET) # prints: GET- Whether the package's behavior with auto() differs meaningfully from Python 3.11+ standard library enum.StrEnum in practice for typical use cases.
- Performance characteristics when enums are used in large-scale string comparisons or lookups.
What it is and what it does
StrEnum provides an Enum subclass whose members are also strings, so they can be used interchangeably with string values in APIs and comparisons. Unlike the standard library's IntEnum, there was no built-in string enum until Python 3.11, and this package fills that gap for earlier versions while offering additional case-conversion variants (camelCase, snake_case, kebab-case, etc.) that the standard library version does not.
The package is lightweight with no runtime dependencies and supports Python 3.7 through 3.12. It's useful when you need enum-like type safety and naming but also need the values to behave as strings—for example, HTTP method names, HTML tag names, or API field names that must match external string conventions.
Use it for
- Define HTTP methods (GET, POST, etc.) as an enum that can be passed directly to urllib or requests without string conversion.
- Create HTML tag enums (head, body, div) where the enum member value matches the lowercase tag name automatically.
- Build API response field enums where member names are converted to snake_case or camelCase to match JSON keys.
- Enforce type safety on string-based configuration options (e.g., log levels, environment names) while keeping values as strings.
- Replace string literals in code with named enum members for better IDE autocomplete and refactoring support.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need string enums on Python 3.7–3.10 or want the case-conversion variants not available in Python 3.11+'s standard library enum.StrEnum.
Low friction, no dependencies, permissive license, and no security issues. Maintenance is dormant but the package is stable and unlikely to need updates. Not necessary if you're on Python 3.11+ and the standard library's StrEnum meets your needs.
Install
strenum on PyPI
Before you install
Low install friction with no runtime dependencies. Dormant maintenance (last release 2023-06-29, last commit 2024-02-08) but marked Production/Stable and no known vulnerabilities.
License in practice
MIT license (permissive) means you can use, modify, and distribute freely with minimal restrictions.
Quickstart
pip install StrEnum
from strenum import StrEnum
from enum import auto
class HttpMethod(StrEnum):
GET = auto()
POST = auto()
assert HttpMethod.GET == "GET"
print(HttpMethod.GET) # prints: GET
Verify before relying
- Whether the package's behavior with auto() differs meaningfully from Python 3.11+ standard library enum.StrEnum in practice for typical use cases.
- Performance characteristics when enums are used in large-scale string comparisons or lookups.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,142 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 40,286,862 / month, #683 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: StrEnum-0.4.15-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “enum inherits from str”
- StrEnumStrEnum is a string-based enum class that inherits from both str and…
- pysubtypesProvides enhanced subclasses for Python builtins (str, list, dict)…
- pydantic-to-pyarrowConverts pydantic model definitions to pyarrow schemas, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
Provides StrEnum, a string-based enumeration class from Python 3.11, for use on Python 3.8.6 through 3.10, allowing enum members to behave as both strings and enumeration constants.
Converts strings to snake_case by normalizing case, stripping punctuation, and handling camelCase or PascalCase inputs.
However, do not use it if you require ongoing maintenance, support for recent Python versions, or security updates—consider a maintained alternative instead.
Converts strings between case styles (snake_case, camelCase, etc.) via Python bindings to the Rust heck library.
However, do not use it if you require ongoing maintenance, bug fixes, or support for new Python versions beyond 3.7.
Extends Python's built-in Enum to support multi-dimensional enum members with multiple attributes and reversible lookups by any attribute value.
Converts strings between different case formats (camel, kebab, pascal, snake, upper) with lenient input handling that ignores punctuation and whitespace.
Converts strings between different text case formats (snake_case, kebab-case, camelCase, PascalCase, etc.) with support for non-ASCII characters and custom word boundaries.
Install it if you need reliable case conversion; the low friction and permissive license make it a safe addition to any project.
See also enum-tools · case-converter · pyhumps · casefy