{"id":23675,"library":"enumb","title":"enumb","description":"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.","status":"active","version":"0.1.5","language":"python","source_language":"en","source_url":"https://github.com/niccokunzmann/enumb","tags":["enum","enums","pythonic","lightweight","bitwise"],"install":[{"cmd":"pip install enumb","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Python's standard library has 'enum.Enum', not 'enumb.Enum'. Using the wrong import will import the standard Enum, not enumb's enhanced version.","wrong":"from enum import Enum","symbol":"Enum","correct":"from enumb import Enum"}],"quickstart":{"code":"from enumb import Enum\n\nclass Color(Enum):\n    RED = 1\n    GREEN = 2\n    BLUE = 3\n\nprint(Color.RED)\nprint(Color.RED.name)\nprint(Color.RED.value)\n# Output:\n# Color.RED\n# RED\n# 1","lang":"python","description":"Define and use a simple enum with enumb."},"warnings":[{"fix":"Use 'from enumb import Enum' explicitly.","message":"Do 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).","severity":"gotcha","affected_versions":"all"},{"fix":"If you need multiple inheritance, consider using enumb's EnumMeta carefully or use composition.","message":"enumb's Enum does not support inheritance from multiple Enum classes by default. Mixing enumb Enum with other classes may cause metaclass conflicts.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.5':24 'advanc':13 'alias':18 'bitwis':16,32 'cadenc':26 'concis':9 'current':22 'definit':11 'enum':5,10,28,29 'enumb':1 'featur':14 'helper':21 'iter':20 'librari':6 'lightweight':3,31 'like':15 'oper':17 'provid':8 'python':4,30 'releas':25 'sporad':27 'version':23","created_at":"2026-05-01T08:09:02.038808+00:00","updated_at":"2026-05-01T08:09:02.038808+00:00","problems":[{"fix":"Ensure all base classes use the same metaclass. Either avoid mixing Enum types or define a custom metaclass that inherits from both metaclasses.","cause":"Trying to inherit from both enumb.Enum and another class that has a different metaclass (e.g., standard library enum.Enum).","error":"TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases"},{"fix":"Use the public API: .name (without underscores) to get the member name.","cause":"Using enumb's Enum but accessing attributes like _name_ which are internal to the standard library's EnumMeta. enumb uses different internal attributes.","error":"AttributeError: 'Color' object has no attribute '_name_'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.1.5","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/enumb/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}