--- id: matrix-enum version: "1.1.0" license: MIT license_treatment: permissive maintenance: abandoned --- # matrix-enum — Data structure for multi-dimensional enums License: permissive · Maintenance: abandoned · Downloads: 115.3K/mo ## What it is and what it does MatrixEnum is a wrapper around Python's standard Enum that lets you define enum members with multiple named attributes instead of a single value. Each member is constructed using a Member object that holds arbitrary key-value pairs, and all members must have the same set of attributes with globally unique values across all attributes. The package automatically makes enum members reversible—you can look up a member by any of its attribute values, not just by name. The main use case is when you need an enum where each entry has several related pieces of data (like a status code, a display label, and a database ID) and you want to retrieve enum members by any of those values interchangeably. It also supports an `extra()` method to attach duplicate-allowed metadata to members. The package depends on six and enum34 for compatibility, though it is no longer maintained as of late 2020. Use it for: - Define a status enum with code, label, and description attributes, then look up by any of them. - Create a mapping of HTTP status codes to reason phrases and canonical names, retrievable by any dimension. - Build an animal classification enum with scientific name, common name, and taxonomy ID, queryable by each. - Store role definitions with numeric ID, string name, and permission level, with reversible lookups. - Represent currency data (code, symbol, name) in a single enum with multi-way lookup. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extends Python's built-in Enum to support multi-dimensional enum members with multiple attributes and reversible lookups by any attribute value. No. The package is abandoned (last commit May 2023, last release December 2020) with no active maintenance. While it works for its narrow use case and has no known vulnerabilities, the lack of updates means it will not adapt to future Python versions or address any bugs that emerge. For new projects, prefer a maintained alternative or implement multi-dimensional enum logic directly using dataclasses or a simple wrapper. ## Install pip install matrix-enum uv add matrix-enum poetry add matrix-enum ## Installing matrix-enum Before you install: Low friction installation with only two lightweight runtime dependencies (six and enum34). However, the package is abandoned—last commit was 2023-05-17 and no releases since 2020-12-04, so expect no maintenance or updates for bugs or compatibility issues. License in practice: MIT license is permissive and places no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install matrix_enum from matrix_enum import MatrixEnum, Member class Status(MatrixEnum): ACTIVE = Member(code=1, label='active') INACTIVE = Member(code=2, label='inactive') print(Status.ACTIVE.code) # 1 print(Status(1) is Status.ACTIVE) # True Requires Python 2.7 or 3.4+; abandoned status means no support for modern Python versions beyond 3.7. Verify before relying: - Whether the package works correctly with Python versions released after 3.7 (last tested version in classifiers). - Real-world performance or stability issues that may have emerged since the last release in December 2020. - Whether six and enum34 dependencies remain compatible with current Python ecosystems. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 115.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags multi-dimensional enums, enum with multiple attributes, reversible enum lookup, enum member attributes, python enum extension, structured enum values, enum with named fields, enum-extension, abandoned [View on SkillFed](https://skillfed.io/packages/matrix-enum) · [View on PyPI](https://pypi.org/project/matrix-enum/)