skillfed

collections-extended

Extra Python Collections - bags (multisets) and setlists (ordered sets)

collections-extended v2.0.2 731.8K downloads/30d#5,204 on PyPI47
Permissive license Apache-2.0 Abandoned released

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 on this page — 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

collections-extended on PyPI

pip

pip install collections-extended

uv

uv add collections-extended

poetry

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 the current Python release (>=3.7,<4.0)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,664 days since the last release
Last repo commit
First released
Downloads 731,821/month — #5,204 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: collections_extended-2.0.2-py3-none-any.whl

Keywords: collections, bag, multiset, ordered set, unique list

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

multiset bag collectionordered set unique listbijection one-to-one mappingindexed dictionary by positionpython collections extended typesrange map date rangeshashable frozen bag setlist
data-structurescollections

More Software Development packages