orderings
Ordering enumeration and protocols.
Decision gist · record as of 2026-08-14
Yes, if you are writing classes that need full comparison support and prefer a single compare method over six dunder methods. The low install friction, permissive MIT license, and lack of security issues make it safe to add. The dormant maintenance is not a blocker for a stable, narrow-scope library, but verify that the Compare protocol integrates well with your existing type hierarchy before committing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or above.
- Low friction: pure Python wheel with only two lightweight runtime dependencies.
- Dormant maintenance since June 2024, though repository remains active and marked Production/Stable.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.
last release 2024-06-05 (800 days) · last repo commit 2024-06-05 · 2 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 109,164 downloads/mo, #12,527 on PyPI
Alternatives
Verify before relying
pip install orderings
from orderings import Compare, Ordering
from typing_extensions import Self
class MyComparable(Compare):
def __init__(self, value):
self.value = value
def compare(self, other: Self) -> Ordering:
if self.value < other.value:
return Ordering.Less
elif self.value > other.value:
return Ordering.Greater
else:
return Ordering.Equal- Whether the Compare protocol integrates cleanly with existing comparison frameworks or requires explicit class inheritance.
- Performance characteristics when Compare is used in large-scale sorting or comparison-heavy workloads.
- Real-world adoption patterns and whether the dormant status indicates the library has reached stable maturity or lacks active maintenance.
What it is and what it does
orderings is a small library that centralizes comparison logic by providing an Ordering enumeration and a Compare protocol. Instead of implementing six separate comparison methods (`__eq__`, `__lt__`, etc.), you define a single `compare` method that returns an Ordering value, and the Compare protocol automatically derives all comparison operations from it. This is particularly useful when you already have a natural ordering function and want to avoid boilerplate.
The package depends on typing-aliases and typing-extensions to support type hints across Python 3.8 and newer. It is fully typed and marked Production/Stable, though development has been dormant since mid-2024. The library is small and self-contained, making it a low-risk addition for projects that benefit from a unified comparison interface.
Use it for
- Implement comparison for custom classes by writing one compare method instead of six dunder methods.
- Build ordered wrapper types that delegate comparison to an inner value using the Compare protocol.
- Simplify comparison logic where a natural ordering function already exists.
- Reduce boilerplate in data structures that need full ordering support but have a single comparison rule.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are writing classes that need full comparison support and prefer a single compare method over six dunder methods.
The low install friction, permissive MIT license, and lack of security issues make it safe to add. The dormant maintenance is not a blocker for a stable, narrow-scope library, but verify that the Compare protocol integrates well with your existing type hierarchy before committing.
Install
orderings on PyPI
Before you install
Low friction: pure Python wheel with only two lightweight runtime dependencies. Dormant maintenance since June 2024, though repository remains active and marked Production/Stable.
Requires Python 3.8 or above.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install orderings
from orderings import Compare, Ordering
from typing_extensions import Self
class MyComparable(Compare):
def __init__(self, value):
self.value = value
def compare(self, other: Self) -> Ordering:
if self.value < other.value:
return Ordering.Less
elif self.value > other.value:
return Ordering.Greater
else:
return Ordering.Equal
Verify before relying
- Whether the Compare protocol integrates cleanly with existing comparison frameworks or requires explicit class inheritance.
- Performance characteristics when Compare is used in large-scale sorting or comparison-heavy workloads.
- Real-world adoption patterns and whether the dormant status indicates the library has reached stable maturity or lacks active maintenance.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagestyping-aliasestyping-extensions |
| Maintenance | Dormant 800 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 109,164 / month, #12,527 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: UtilitiesTyping :: Typed |
Evidence: orderings-1.6.0-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 › “ordering enumeration protocol”
- orderingsProvides an Ordering enumeration and Compare protocol to unify…
- pyusbPyUSB provides Python access to USB devices on the host machine…
- serialxSerialx provides synchronous and native asynchronous APIs for serial…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also logical-unification · ordered-enum · django-ordered-model · mixed-methods · versions · fractional-indexing · lexid · wraps · async-extensions