Registry / serialization / enumb
library0.1.5pypypi✓ verified 85d ago

A lightweight, Pythonic enum library that provides concise enum definitions with advanced features like bitwise operations, aliases, and iteration helpers. Current version: 0.1.5. Release cadence: sporadic.

pip install enumb
INSTALL
IMPORT
SIG · ENUMB
E
enumb
serializationpythonv0.1.5
Install
1.6s avg
Import
136ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.144s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.128s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Enum
from enumb import Enum
from enum import Enum
Python's standard library has 'enum.Enum', not 'enumb.Enum'. Using the wrong import will import the standard Enum, not enumb's enhanced version.

Define and use a simple enum with enumb.

from enumb import Enum class Color(Enum): RED = 1 GREEN = 2 BLUE = 3 print(Color.RED) print(Color.RED.name) print(Color.RED.value) # Output: # Color.RED # RED # 1
Debug
Known issues
gotchaDo not import Enum from the standard library 'enum' when intending to use enumb. The standard library Enum has different behavior (e.g., no automatic value assignment, different member iteration).
fix
Use 'from enumb import Enum' explicitly.
affects: all
gotchaenumb's Enum does not support inheritance from multiple Enum classes by default. Mixing enumb Enum with other classes may cause metaclass conflicts.
fix
If you need multiple inheritance, consider using enumb's EnumMeta carefully or use composition.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Trying to inherit from both enumb.Enum and another class that has a different metaclass (e.g., standard library enum.Enum).
fix
Ensure all base classes use the same metaclass. Either avoid mixing Enum types or define a custom metaclass that inherits from both metaclasses.
AttributeError: 'Color' object has no attribute '_name_'
Using enumb's Enum but accessing attributes like _name_ which are internal to the standard library's EnumMeta. enumb uses different internal attributes.
fix
Use the public API: .name (without underscores) to get the member name.
Upgrade
Version history
0.1.5latest on PyPI · released Nov 10, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
enumb — pip install enumb · libregistry