ordered-enum
A small library for adding total orderings to enums
Decision gist · record as of 2026-08-14
Yes, if you need enum comparison. The package is lightweight, actively maintained, has no dependencies, and solves a real gap in Python's standard enum module. The only caveat is the unclear license status—verify that it's compatible with your project's requirements before committing to it.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or newer.
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained with a recent release (417 days ago) and a live repository.
License · maintenance · safety
(unclear)
last release 2025-06-23 (417 days) · last repo commit 2026-08-12 · 31 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 152,094 downloads/mo, #10,911 on PyPI
Alternatives
Verify before relying
from ordered_enum import OrderedEnum
class State(OrderedEnum):
Disabled = 4
Loaded = 3
Waiting = 2
Running = 1
Dead = 0
print(State.Disabled > State.Loaded) # True
print(sorted([State.Dead, State.Waiting])) # [State.Waiting, State.Dead]- Whether the package is suitable for production use given the unclear license status and lack of explicit license declaration.
What it is and what it does
ordered_enum is a minimal library that makes Python enum members comparable and sortable by implementing total ordering. It provides two base classes: OrderedEnum, which orders members by their definition sequence in the class body, and ValueOrderedEnum, which orders members by their assigned values. The library requires Python 3.9 or newer and has no external dependencies, making it a lightweight addition to projects that need to sort or compare enum states.
The typical use case is state machines or priority systems where you want to compare enum members directly (e.g., State.Running < State.Waiting) or sort collections of them. OrderedEnum is more flexible since it doesn't require unique values; ValueOrderedEnum enforces uniqueness but orders by the numeric or comparable value you assign to each member.
Use it for
- Implement state machines where you need to check if one state is 'before' or 'after' another in a defined sequence.
- Sort priority or severity enums (e.g., log levels) by their numeric values without manual conversion.
- Build workflow systems that compare enum states to determine valid transitions or precedence.
- Create ordered status enums for database records or API responses that need to be ranked or filtered.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need enum comparison.
The package is lightweight, actively maintained, has no dependencies, and solves a real gap in Python's standard enum module. The only caveat is the unclear license status—verify that it's compatible with your project's requirements before committing to it.
Install
ordered-enum on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a recent release (417 days ago) and a live repository.
Requires Python 3.9 or newer.
Quickstart
from ordered_enum import OrderedEnum
class State(OrderedEnum):
Disabled = 4
Loaded = 3
Waiting = 2
Running = 1
Dead = 0
print(State.Disabled > State.Loaded) # True
print(sorted([State.Dead, State.Waiting])) # [State.Waiting, State.Dead]
Verify before relying
- Whether the package is suitable for production use given the unclear license status and lack of explicit license declaration.
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 417 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 152,094 / month, #10,911 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: ordered_enum-0.0.10-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 comparison operators”
- ordered-enumAdds comparison operators to Python enums so they can be sorted and…
- aenumaenum provides advanced enumeration types (Enum, IntEnum, Flag,…
- ntstatusProvides Python constants and lookup methods for Windows API…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also orderings · matrix-enum · aenum · enum-tools · infinity · django-choices-field · django-enum · StrEnum · django-enumfields · enum34