more_itertools
These tools yield groups of items from a source iterable.
New itertools
chunked
sliced
distribute
divide
split_at
split_before
split_after
bucket
Itertools recipes
grouper
partition
These tools peek at an iterable's values without advancing it.
New itertools
spy
peekable
seekable
These tools yield windows of items from an iterable.
New itertools
windowed
stagger
Itertools recipes
pairwise
These tools yield items from an iterable, plus additional data.
New itertools
count_cycle
intersperse
padded
adjacent
groupby_transform
Itertools recipes
padnone
ncycles
These tools combine multiple iterables.
New itertools
collapse
sort_together
interleave
interleave_longest
collate(*iterables, key=lambda a: a, reverse=False)
zip_offset(*iterables, offsets, longest=False, fillvalue=None)
Itertools recipes
dotproduct
flatten
roundrobin
prepend
These tools return summarized or aggregated data from an iterable.
New itertools
ilen
first(iterable[, default])
last(iterable[, default])
one
unique_to_each
locate(iterable, pred=bool, window_size=None)
rlocate(iterable, pred=bool, window_size=None)
consecutive_groups(iterable, ordering=lambda x: x)
exactly_n(iterable, n, predicate=bool)
run_length
map_reduce
Itertools recipes
all_equal
first_true
nth
quantify(iterable, pred=bool)
These tools yield certain items from an iterable.
New itertools
islice_extended(start, stop, step)
strip
lstrip
rstrip
Itertools recipes
take
tail
unique_everseen
unique_justseen
These tools yield combinatorial arrangements of items from iterables.
New itertools
distinct_permutations
circular_shifts
Itertools recipes
powerset
random_product
random_permutation
random_combination
random_combination_with_replacement
nth_combination
These tools provide wrappers to smooth working with objects that produce or consume iterables.
New itertools
always_iterable
consumer
with_iter
Itertools recipes
iter_except
New itertools
replace
numeric_range(start, stop, step)
always_reversible
side_effect
iterate
difference(iterable, func=operator.sub)
make_decorator
SequenceView
Itertools recipes
consume
accumulate(iterable, func=operator.add)
tabulate
repeatfunc