Registry / devops / matrix-enum

matrix-enum

JSON →
library1.1.0pypypi✓ verified 84d ago

Data structure for multi-dimensional enums. Version 1.1.0, maintained sporadically. Supports Python 2.7+ and 3.6+.

pip install matrix-enum
INSTALL
IMPORT
SIG · MATRIX-ENUM
M
matrix-enum
devopspythonv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

MatrixEnum
from matrix_enum import MatrixEnum
from matrix_enum import Matrix
Class is MatrixEnum, not Matrix
MatrixEnumValue
from matrix_enum import MatrixEnumValue

Define and use a simple MatrixEnum.

from matrix_enum import MatrixEnum class ColorMatrix(MatrixEnum): RED = 1 GREEN = 2 BLUE = 3 print(ColorMatrix.RED)
Debug
Known issues
gotchaPython 2 compatibility: values must be integers, not strings.
fix
Use integer values only.
affects: <1.0
gotchaMatrixEnum does not support members with duplicate values; raises ValueError.
fix
Ensure each value is unique.
affects: >=1.0
Errors
Common errors & fixes
AttributeError: module 'matrix_enum' has no attribute 'MatrixEnum'
Installation of wrong package 'matrix-enum' (note hyphen vs underscore).
fix
pip install matrix-enum
ImportError: No module named matrix_enum
Package not installed or installed as 'matrix_enum' but import path is 'matrix_enum'.
fix
Ensure correct installation: pip install matrix-enum
Upgrade
Version history
1.1.0latest on PyPI · released Dec 4, 2020
Audit
Dependencies
enum34optionalBackport of enum for Python <3.4
Agent activity
2 hits · last 30 days
node
2
Resources
matrix-enum — pip install matrix-enum · libregistry