{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/10"}],"enrichment":{"capability":"Provides an Ordering enumeration and Compare protocol to unify comparison logic into a single method, letting you implement all ordering operations (`==`, `!=`, `<`, `>`, `<=`, `>=`) from one compare function.","skillfed_tags":["comparison-protocol","type-hints"],"use_cases":["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."],"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.\n\nThe 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.","worth_installing":"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."},"id":"orderings","links":{"html":"https://skillfed.io/packages/orderings","md":"https://skillfed.io/packages/orderings.md","pypi":"https://pypi.org/project/orderings/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-06-05","license_spdx":null,"license_treatment":"permissive","name":"orderings","python_support":"supports_current","summary":"Ordering enumeration and protocols."},"popularity":{"monthly_downloads":109164,"position":12527,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.6.0"}
