{"id":17968835,"url":"https://github.com/matthiasdiener/orderedsets","last_synced_at":"2026-03-06T06:32:10.428Z","repository":{"id":185715855,"uuid":"673909375","full_name":"matthiasdiener/orderedsets","owner":"matthiasdiener","description":"Mutable and immutable ordered sets.","archived":false,"fork":false,"pushed_at":"2025-11-24T15:26:24.000Z","size":508,"stargazers_count":1,"open_issues_count":9,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-28T04:14:46.313Z","etag":null,"topics":["ordered-set","python","sets"],"latest_commit_sha":null,"homepage":"https://matthiasdiener.github.io/orderedsets/","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/matthiasdiener.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-02T17:44:28.000Z","updated_at":"2025-11-24T15:26:26.000Z","dependencies_parsed_at":"2023-10-27T15:33:44.113Z","dependency_job_id":"1fdf7a0b-adb2-47e9-9b96-ddec297d94ab","html_url":"https://github.com/matthiasdiener/orderedsets","commit_stats":null,"previous_names":["matthiasdiener/orderedsets"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/matthiasdiener/orderedsets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasdiener%2Forderedsets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasdiener%2Forderedsets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasdiener%2Forderedsets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasdiener%2Forderedsets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthiasdiener","download_url":"https://codeload.github.com/matthiasdiener/orderedsets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiasdiener%2Forderedsets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ordered-set","python","sets"],"created_at":"2024-10-29T14:41:42.602Z","updated_at":"2026-03-06T06:32:10.394Z","avatar_url":"https://github.com/matthiasdiener.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/orderedsets.svg)](https://badge.fury.io/py/orderedsets)\n[![Doc Status](https://img.shields.io/github/actions/workflow/status/matthiasdiener/orderedsets/doc.yaml?label=docs)](https://matthiasdiener.github.io/orderedsets)\n[![License](https://img.shields.io/pypi/l/orderedsets)](https://github.com/matthiasdiener/orderedsets/blob/main/LICENSE)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/orderedsets)](https://badge.fury.io/py/orderedsets)\n\n# orderedsets\n\nAn implementation of mutable and immutable ordered sets as thin wrappers around\nPython's `dict` class.\nThese classes are meant as drop-in replacements for Python's builtin `set` and\n`frozenset` classes. Care has been taken to provide the same functionality as the Python classes,\nwithout API additions or removals, to allow easy switching between set implementations. These classes are often\n[faster than other ordered set implementations](https://matthiasdiener.github.io/orderedsets/speed.html)\n(but slower than Python's builtin sets).\n\nIn contrast to Python's builtin `set` and `frozenset` classes, the order of\nitems is kept (generally, insertion order), such that iterating over items in\nthe set as well as mutating operations are deterministic.\n\nThis package has no external dependencies.\n\n\n## Usage\n\nInstall this package with:\n```\n$ pip install orderedsets\n```\n\nUsage example:\n```python\nfrom orderedsets import OrderedSet, FrozenOrderedSet\n\nos = OrderedSet([1, 2, 4])\nos.add(0)\nassert list(os) == [1, 2, 4, 0]\nos.remove(0)\n\nfos = FrozenOrderedSet([1, 2, 4])\n# a.add(0)  # raises AttributeError: 'FrozenOrderedSet' object has no attribute 'add'\nassert list(fos) == [1, 2, 4]\n\n# sets with the same elements compare equal\nassert os == fos == set([1, 2, 4]) == frozenset([1, 2, 4])\n\n# only immutable sets can be hashed\nassert hash(fos) == hash(frozenset([1, 2, 4]))\n```\n\nPlease also see the [documentation](https://matthiasdiener.github.io/orderedsets).\n\n\n## References\n\n### Other packages\n\n- https://github.com/rindPHI/proxyorderedset/ (not 100% compatible with set)\n- https://pypi.org/project/ordered-set/ (no frozen/immutable class)\n- https://pypi.org/project/stableset/ (no frozen/immutable class)\n- https://pypi.org/project/orderedset/ (Cython, no frozen/immutable class)\n- https://pypi.org/project/Ordered-set-37/ (no frozen/immutable class)\n- https://pypi.org/project/sortedcollections (no frozen/immutable class)\n- https://github.com/grantjenks/python-sortedcollections (no frozen/immutable class)\n- https://github.com/Erotemic/ubelt (pure Python, no frozen/immutable class)\n\n### Discussions\n\n- https://discuss.python.org/t/add-orderedset-to-stdlib/12730\n\n### Python implementations\n\n- https://github.com/python/cpython/blob/main/Objects/setobject.c\n- https://github.com/python/cpython/blob/main/Objects/dictobject.c\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiasdiener%2Forderedsets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthiasdiener%2Forderedsets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiasdiener%2Forderedsets/lists"}