{"id":322,"library":"more-itertools","title":"More Itertools","description":"A Python package offering additional routines for working with iterables, extending beyond the standard itertools module. Current version: 10.8.0. Maintained with regular updates to enhance functionality and performance.","status":"active","version":"10.8.0","language":"python","source_language":"en","source_url":"https://github.com/more-itertools/more-itertools","tags":["iterables","itertools","python","utilities","library"],"install":[{"cmd":"pip install more-itertools","lang":"bash","label":"Install More Itertools"}],"dependencies":[{"reason":"Standard library module providing foundational iterable functions.","package":"itertools"}],"imports":[{"note":"Ensure correct import path to access the 'chunked' function.","symbol":"chunked","correct":"from more_itertools import chunked"},{"note":"Ensure correct import path to access the 'windowed' function.","symbol":"windowed","correct":"from more_itertools import windowed"}],"quickstart":{"code":"from more_itertools import chunked\n\niterable = [0, 1, 2, 3, 4, 5, 6, 7, 8]\nresult = list(chunked(iterable, 3))\nprint(result)\n\n# Output:\n# [[0, 1, 2], [3, 4, 5], [6, 7, 8]]","lang":"python","description":"Demonstrates the 'chunked' function to divide an iterable into chunks of specified size."},"warnings":[{"fix":"Upgrade to Python 3.8 or later.","message":"Python 3.7 support dropped in version 10.0.0 due to its end of life on 2023-06-27.","severity":"breaking","affected_versions":"10.0.0"},{"fix":"Update code to handle 'None' as a default return value.","message":"The 'first_true()' function now returns 'None' by default, changing its previous behavior.","severity":"breaking","affected_versions":"5.0.0"},{"fix":"Use 'itertools.batched' directly in Python 3.12+.","message":"The 'batched()' function is now an alias for 'itertools.batched' in Python 3.12 and later.","severity":"deprecated","affected_versions":"10.0.0"},{"fix":"Review and adjust usage of 'strict' parameter in 'chunked()' and 'sliced()' functions.","message":"The 'chunked()' and 'sliced()' functions now accept a 'strict' parameter, affecting their behavior.","severity":"gotcha","affected_versions":"10.7.0"}],"env_vars":null,"search_vec":"'10.8.0':21 'addit':7 'beyond':14 'current':19 'enhanc':27 'extend':13 'function':28 'iter':12,31 'itertool':2,17,32 'librari':35 'maintain':22 'modul':18 'offer':6 'packag':5 'perform':30 'python':4,33 'regular':24 'routin':8 'standard':16 'updat':25 'util':34 'version':20 'work':10","created_at":"2026-03-28T08:31:17.539698+00:00","updated_at":"2026-04-16T16:39:20.564473+00:00","problems":[{"fix":"Install the package using pip: `pip install more-itertools`","cause":"The 'more-itertools' package is not installed in your Python environment.","error":"ModuleNotFoundError: No module named 'more_itertools'"},{"fix":"To get the installed version, use `pkg_resources` or `importlib.metadata` (Python 3.8+): `import pkg_resources; pkg_resources.get_distribution('more-itertools').version` or `import importlib.metadata; importlib.metadata.version('more-itertools')`","cause":"The `more_itertools` module does not expose its version via a `__version__` attribute directly within the module itself, unlike some other packages.","error":"AttributeError: module 'more_itertools' has no attribute '__version__'"},{"fix":"Either upgrade your Python version to 3.10 or newer, or import `pairwise` from `more_itertools`: `from more_itertools import pairwise` (after ensuring `more-itertools` is installed).","cause":"The `pairwise` function was added to the standard `itertools` module in Python 3.10. If you are using an older Python version (e.g., 3.9 or below), `pairwise` is only available in the `more-itertools` library.","error":"ImportError: cannot import name 'pairwise' from 'itertools'"},{"fix":"Either ensure the input iterable's length is a multiple of `n`, or remove `strict=True` to allow the last chunk to be shorter, or handle incomplete batches by setting `incomplete='fill'` or `incomplete='ignore'` (for `grouper`).","cause":"This error occurs when using `more_itertools.chunked()` (or `sliced()`) with `strict=True`, and the length of the input iterable is not perfectly divisible by the chunk size `n`.","error":"ValueError: chunked(): incomplete batch"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"11.1.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/more-itertools/more-itertools","docs":"https://more-itertools.readthedocs.io/en/stable/","changelog":null,"pypi":"https://pypi.org/project/more-itertools/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":"verified"}}