skillfed

jaraco.collections

Collection objects similar to those in stdlib by jaraco

jaraco-collections v5.2.1 1.3M downloads/30d#4,144 on PyPI15
Permissive license MIT Active released

What it is and what it does

jaraco.collections supplements Python's standard collections module with specialized mapping and container classes designed for common patterns that the stdlib doesn't directly address. It provides RangeMap for key lookups across ranges, case-insensitive keyed dicts, bijective maps where values map back to keys, immutable FrozenDict, and several other utility containers like DictStack for scope management and WeightedLookup for probabilistic selection.

The package is a lightweight addition to your toolkit—it has only one runtime dependency and installs as a pure Python wheel. It's actively maintained and has been in production use since 2015-02-16, making it suitable for projects that need these specific collection patterns without building custom implementations.

Use it for:

  • Use RangeMap when you need to map ranges of numeric values to results, like scoring systems or tier-based lookups.
  • Use FoldedCaseKeyedDict for case-insensitive configuration or lookup tables where key matching should ignore case.
  • Use BijectiveMap when you need bidirectional mapping where both keys and values are valid lookups.
  • Use FrozenDict when you need an immutable, hashable mapping to use as a dict key or in sets.
  • Use DictStack to manage nested scopes or configuration layers that inherit from parent contexts.
  • Use WeightedLookup to select items probabilistically based on assigned weights.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides specialized collection classes that extend Python's standard library collections module, including range-based mappings, case-insensitive dicts, bijective maps, and other utility containers.

Yes. The package offers genuine utility for common collection patterns, has low install friction, no known vulnerabilities, and is actively maintained under a permissive MIT license. Install it if your code needs any of its specialized mappings; otherwise, it's not a required dependency.

Install

jaraco-collections on PyPI

pip

pip install jaraco-collections

uv

uv add jaraco-collections

poetry

poetry add jaraco-collections

Installing jaraco.collections

Before you install

Low install friction with a single runtime dependency. The package is actively maintained with a recent commit on 2026-04-13 and has been stable since its first release in 2015-02-16.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.

Quickstart

pip install jaraco.collections

from jaraco.collections import RangeMap

rm = RangeMap()
rm[range(0, 5)] = 'low'
rm[range(5, 15)] = 'high'
print(rm[3])

Requires Python 3.9 or later.

Verify before relying

  • Whether FrozenDict is truly hashable and suitable for use as dict keys in all scenarios
  • Performance characteristics of RangeMap and WeightedLookup with large datasets
  • Whether ItemsAsAttributes correctly handles all edge cases with reserved attribute names

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — jaraco.text
Maintenance actively maintained — 419 days since the last release
Last repo commit
First released
Downloads 1,263,840/month — #4,144 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: jaraco_collections-5.2.1-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Tags

specialized dict implementationsrange-based mappingcase-insensitive dictionarybijective mapcollection utilitiesadvanced mapping classesimmutable hashable dict
data-structuresstdlib-supplement

More Software Development packages