{"id":43242240,"url":"https://github.com/nekitdev/orderings","last_synced_at":"2026-02-01T11:38:57.321Z","repository":{"id":63896693,"uuid":"571610084","full_name":"nekitdev/orderings","owner":"nekitdev","description":"Ordering enumeration and protocols.","archived":false,"fork":false,"pushed_at":"2024-06-05T12:17:41.000Z","size":455,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-08T21:12:52.581Z","etag":null,"topics":["ordering","python"],"latest_commit_sha":null,"homepage":"https://nekitdev.github.io/orderings","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nekitdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["nekitdev"],"custom":"https://nekit.dev/funding"}},"created_at":"2022-11-28T14:00:14.000Z","updated_at":"2024-06-05T12:17:33.000Z","dependencies_parsed_at":"2024-03-02T12:28:41.205Z","dependency_job_id":"1582ee55-9a5c-4336-9bbf-07685392f1cc","html_url":"https://github.com/nekitdev/orderings","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"4530f566a15e4605dd8d822fa1934c0516020ffe"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nekitdev/orderings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Forderings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Forderings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Forderings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Forderings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nekitdev","download_url":"https://codeload.github.com/nekitdev/orderings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Forderings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28977334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T11:31:13.034Z","status":"ssl_error","status_checked_at":"2026-02-01T11:30:25.558Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ordering","python"],"created_at":"2026-02-01T11:38:57.251Z","updated_at":"2026-02-01T11:38:57.315Z","avatar_url":"https://github.com/nekitdev.png","language":"Python","readme":"# `orderings`\n\n[![License][License Badge]][License]\n[![Version][Version Badge]][Package]\n[![Downloads][Downloads Badge]][Package]\n[![Discord][Discord Badge]][Discord]\n\n[![Documentation][Documentation Badge]][Documentation]\n[![Check][Check Badge]][Actions]\n[![Test][Test Badge]][Actions]\n[![Coverage][Coverage Badge]][Coverage]\n\n\u003e *Ordering enumeration and protocols.*\n\n## Installation\n\n**Python 3.8 or above is required.**\n\n### `pip`\n\nInstalling the library with `pip` is quite simple:\n\n```console\n$ pip install orderings\n```\n\nAlternatively, the library can be installed from source:\n\n```console\n$ pip install git+https://github.com/nekitdev/orderings.git\n```\n\nOr via cloning the repository:\n\n```console\n$ git clone https://github.com/nekitdev/orderings.git\n$ cd orderings\n$ pip install .\n```\n\n### `poetry`\n\nYou can add `orderings` as a dependency with the following command:\n\n```console\n$ poetry add orderings\n```\n\nOr by directly specifying it in the configuration like so:\n\n```toml\n[tool.poetry.dependencies]\norderings = \"^1.6.0\"\n```\n\nAlternatively, you can add it directly from the source:\n\n```toml\n[tool.poetry.dependencies.orderings]\ngit = \"https://github.com/nekitdev/orderings.git\"\n```\n\n## Motivation\n\nSometimes it's simpler to handle ordering in one method, for example when comparing iterators;\nthen it's trivial to implement the regular ordering methods using the `compare` method.\n\n## Examples\n\n### Core\n\nThe core of `orderings` is the [`Ordering`][orderings.core.Ordering] enumeration\nand the [`Compare`][orderings.core.Compare] protocol:\n\n```python\nfrom typing import Generic, TypeVar\n\nfrom attrs import frozen\nfrom orderings import Compare, Ordered, Ordering, compare\nfrom typing_extensions import Self\n\nT = TypeVar(\"T\", bound=Ordered)\n\n\n@frozen()\nclass Wrap(Compare, Generic[T]):\n    value: T\n\n    def compare(self, other: Self) -\u003e Ordering:\n        return compare(self.value, other.value)\n```\n\n[`Compare`][orderings.core.Compare] implements all ordering operations\n(`==`, `!=`, `\u003c`, `\u003e`, `\u003c=`, `\u003e=`) using the [`compare`][orderings.core.Compare.compare] method.\n\n## Documentation\n\nYou can find the documentation [here][Documentation].\n\n## Support\n\nIf you need support with the library, you can send an [email][Email]\nor refer to the official [Discord server][Discord].\n\n## Changelog\n\nYou can find the changelog [here][Changelog].\n\n## Security Policy\n\nYou can find the Security Policy of `orderings` [here][Security].\n\n## Contributing\n\nIf you are interested in contributing to `orderings`, make sure to take a look at the\n[Contributing Guide][Contributing Guide], as well as the [Code of Conduct][Code of Conduct].\n\n## License\n\n`orderings` is licensed under the MIT License terms. See [License][License] for details.\n\n[Email]: mailto:support@nekit.dev\n\n[Discord]: https://nekit.dev/chat\n\n[Actions]: https://github.com/nekitdev/orderings/actions\n\n[Changelog]: https://github.com/nekitdev/orderings/blob/main/CHANGELOG.md\n[Code of Conduct]: https://github.com/nekitdev/orderings/blob/main/CODE_OF_CONDUCT.md\n[Contributing Guide]: https://github.com/nekitdev/orderings/blob/main/CONTRIBUTING.md\n[Security]: https://github.com/nekitdev/orderings/blob/main/SECURITY.md\n\n[License]: https://github.com/nekitdev/orderings/blob/main/LICENSE\n\n[Package]: https://pypi.org/project/orderings\n[Coverage]: https://codecov.io/gh/nekitdev/orderings\n[Documentation]: https://nekitdev.github.io/orderings\n\n[Discord Badge]: https://img.shields.io/discord/728012506899021874\n[License Badge]: https://img.shields.io/pypi/l/orderings\n[Version Badge]: https://img.shields.io/pypi/v/orderings\n[Downloads Badge]: https://img.shields.io/pypi/dm/orderings\n\n[Documentation Badge]: https://github.com/nekitdev/orderings/workflows/docs/badge.svg\n[Check Badge]: https://github.com/nekitdev/orderings/workflows/check/badge.svg\n[Test Badge]: https://github.com/nekitdev/orderings/workflows/test/badge.svg\n[Coverage Badge]: https://codecov.io/gh/nekitdev/orderings/branch/main/graph/badge.svg\n\n[orderings.core.Compare]: https://nekitdev.github.io/orderings/reference/core#orderings.core.Compare\n[orderings.core.Compare.compare]: https://nekitdev.github.io/orderings/reference/core#orderings.core.Compare.compare\n[orderings.core.Ordering]: https://nekitdev.github.io/orderings/reference/core#orderings.core.Ordering\n","funding_links":["https://github.com/sponsors/nekitdev","https://nekit.dev/funding"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekitdev%2Forderings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnekitdev%2Forderings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekitdev%2Forderings/lists"}