Registry / devops / jaraco-itertools

jaraco-itertools

JSON →
library6.4.3pypypi✓ verified 84d ago

Extensions to the Python itertools module including additional iterator building blocks and recipes. Current version: 6.4.3, compatible with Python >=3.9. Released under the jaraco namespace; stable maintenance with infrequent breaking changes.

pip install jaraco-itertools
INSTALL
IMPORT
SIG · JARACO-ITERTOOLS
J
jaraco-itertools
devopspythonv6.4.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

always_iterable
from jaraco.itertools import always_iterable
from jaraco.itertools import always_iterable
No common mistake; always use the correct import.
collate
from jaraco.itertools import collate
from itertools import collate
Collate is not in stdlib itertools; must be imported from jaraco.itertools.
padnone
from jaraco.itertools import padnone
from itertools import padnone
padnone is a recipe from itertools docs but not in stdlib; jaraco provides it.

Demonstrates basic usage of always_iterable and collate.

from jaraco.itertools import always_iterable, collate # Example usage items = always_iterable([1, 2]) # returns iterable unchanged items2 = always_iterable(1) # wraps int in a list print(list(items)) print(list(items2)) # Collate multiple iterables for x in collate([1, 3, 5], [2, 4, 6], key=lambda x: x): print(x)
Debug
Known issues
breakingRemoved functions: run_length, split_before, split_after, split_at, split_when, bucket, quantify, first_true, etc. were removed in version 5.0.0+.
fix
Use more-itertools or copy the recipes directly.
affects: >=5.0.0
deprecatedFunctions like always_iterable and collate are stable; but some itertools recipes from Python docs are not provided by jaraco.itertools anymore.
fix
Check the official documentation for available functions.
affects: >=6.0
gotchaImport path is jaraco.itertools (dot notation), not jaraco_itertools.
fix
Use `import jaraco.itertools` or `from jaraco.itertools import ...`
affects: all
gotchaSome functions are generators and must be consumed; they return iterator objects not lists.
fix
Wrap with list() if you need a list.
affects: all
Errors
Common errors & fixes
ImportError: No module named jaraco.itertools
The package is installed but Python cannot find the module; likely installed in a different environment or the package name is jaraco-itertools (pip) while import is jaraco.itertools.
fix
Verify install: `pip list | grep jaraco`. Import as `import jaraco.itertools` (not `import jaraco_itertools`).
AttributeError: module 'jaraco.itertools' has no attribute 'always_iterable'
An older version of jaraco.itertools may not have always_iterable, or the function was renamed/removed.
fix
Upgrade to latest version: `pip install --upgrade jaraco-itertools`. Check available functions in documentation.
TypeError: 'NoneType' object is not iterable
Passing None to a function that expects an iterable (e.g., always_iterable(None) will yield an empty iterator, not error). If using other functions, they may not handle None.
fix
Use always_iterable to wrap potential None values. For other functions, handle None before calling.
Upgrade
Version history
6.4.3latest on PyPI · released May 10, 2025
Audit
Dependencies
more-itertoolsrequiredUsed internally for some utility functions
Agent activity
4 hits · last 30 days
node
4
Resources
jaraco-itertools — pip install jaraco-itertools · libregistry