jaraco.collections
Collection objects similar to those in stdlib by jaraco
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-collectionsuv
uv add jaraco-collectionspoetry
poetry add jaraco-collectionsInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
collections-extendedProvides four specialized collection types—bag…
permissive · top 15,000 on PyPI
jaraco.classesProvides utility functions for working with…
permissive · top 1,000 on PyPI
jaraco.functoolsProvides additional functional programming…
permissive · top 1,000 on PyPI
zictProvides mutable mapping tools and data…
permissive · top 5,000 on PyPI
immutablesProvides an immutable mapping type backed by a…
permissive · top 5,000 on PyPI
frozendictProvides an immutable, hashable dictionary…
copyleft · top 5,000 on PyPI
constantdictProvides an immutable dictionary class that…
permissive · top 15,000 on PyPI
immutabledictProvides an immutable dictionary wrapper that…
permissive · top 1,000 on PyPI
frozenlistProvides a list-like container that starts…
permissive · top 100 on PyPI
montyMonty provides supplementary utility functions…
permissive · top 5,000 on PyPI