--- id: collections-extended version: "2.0.2" license: Apache-2.0 license_treatment: permissive maintenance: abandoned --- # collections-extended — Extra Python Collections - bags (multisets) and setlists (ordered sets) License: permissive · Maintenance: abandoned · Downloads: 731.8K/mo ## What it is and what it does collections_extended is a pure Python library that adds four specialized collection types to Python's standard library. It provides bag (a multiset that tracks element counts), setlist (an ordered set combining list indexing with set uniqueness), bijection (a bidirectional one-to-one mapping), and IndexedDict (a dictionary that also supports integer index access). Each type has a frozen (hashable) variant. The library has no external dependencies and works with Python 3.6, 3.7, 3.8, 3.9, 3.10 and PyPy3. The package is useful when you need collections with specific semantics that the standard library doesn't provide—for instance, when you need to count occurrences of items like a Counter but with removal semantics, or when you need both fast membership testing and positional access like a set and a list combined. However, the project is no longer maintained: the last release was 2022-01-23 and the last commit 2023-03-12, so it will not receive updates or bug fixes. Use it for: - Track element frequencies with removal: use bag when you need multiset semantics with count() and remove() operations. - Maintain insertion order with uniqueness: use setlist when you need a list that forbids duplicates and supports fast membership testing. - Bidirectional key-value mapping: use bijection when you need to look up values by key and keys by value interchangeably. - Access dictionary entries by position: use IndexedDict when you need both key-based and index-based access to an ordered mapping. - Range-based lookups: use RangeMap to map contiguous ranges (dates, numbers) to values and query which range contains a given point. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides four specialized collection types—bag (multiset), setlist (ordered set), bijection (one-to-one mapping), and IndexedDict (ordered dict with index access)—as pure Python implementations with no external dependencies. Yes, if you need one of these specialized collection types and can accept that the package will not receive updates. The code is stable, has no dependencies, and works with current Python versions. No, if you require active maintenance or plan to rely on future bug fixes—consider whether the standard library or a maintained alternative meets your needs instead. ## Install pip install collections-extended uv add collections-extended poetry add collections-extended ## Installing collections-extended Before you install: Installation is frictionless—a pure Python wheel with no runtime dependencies. However, the package is marked abandoned with no commits since 2023-03-12 and no releases for over a year, so expect no maintenance or bug fixes going forward. License in practice: Licensed under Apache-2.0 (permissive), which allows commercial and private use with minimal restrictions—suitable for most projects without legal concern. Quickstart: pip install collections-extended from collections_extended import bag, setlist, bijection, IndexedDict b = bag('abracadabra') print(b.count('a')) # 5 sl = setlist('abracadabra') print(sl[0]) # 'a' bij = bijection({'a': 1, 'b': 2}) print(bij.inverse[1]) # 'a' idict = IndexedDict() idict['key'] = 'value' print(idict.get(index=0)) # 'value' Requires Python >=3.7,<4.0; Python 2 is not supported. Verify before relying: - Performance characteristics compared to standard dict/set for large datasets - Real-world adoption patterns and whether abandonment poses practical risk for your use case ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 731.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags multiset bag collection, ordered set unique list, bijection one-to-one mapping, indexed dictionary by position, python collections extended types, range map date ranges, hashable frozen bag setlist, data-structures, collections [View on SkillFed](https://skillfed.io/packages/collections-extended) · [View on PyPI](https://pypi.org/project/collections-extended/)