Skip to main content

Itertools shim with recipes and extras

Project description

A drop-in replacement for itertools including the recipes from the itertools document page(including tests) and some extras.

The extras.py file adds a couple of useful function along with an alternate pairwise function to avoid over-loading with tee, an alternate partition function to return lists instead of generators as tee would have also generated the overhead and the predicate would have run twice for each element, and an alternate powerset function providing a reverse argument.

  • multi-map converts an itertable into a multi-map(dict of lists)

  • split splits an iterable into segments similar to string.split

  • chunk chunks data into segments of a limited size - similar to grouper

  • divide evenly divides elements into a fixed number of chunks

  • divide_sizes determine the sizes of chunks if a number of elements were evenly divided

All of itertools and the functions in extra.py are pulled in on __init__.

The recipes are included in the recipes.py file and are pulled in on __init__ with the exception of the alternates provided by extra.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nx_itertools-1.3.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file nx_itertools-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nx_itertools-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9def7059d8dba7fdf6b41c4d44a747ec9402c47c6eda2c6c4af729e9f1adc7f7
MD5 e5d0add945a7a0a6cedb9151310a0801
BLAKE2b-256 5348b9fc27f52875f95a1bbc6f78ca22c92cfce8819bacf5d64be0ebc8f6070a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page