{"id":13468686,"url":"https://github.com/more-itertools/more-itertools","last_synced_at":"2026-04-03T00:01:35.116Z","repository":{"id":3117564,"uuid":"4144530","full_name":"more-itertools/more-itertools","owner":"more-itertools","description":"More routines for operating on iterables, beyond itertools","archived":false,"fork":false,"pushed_at":"2026-04-01T16:44:38.000Z","size":2889,"stargazers_count":4049,"open_issues_count":14,"forks_count":311,"subscribers_count":38,"default_branch":"master","last_synced_at":"2026-04-01T23:38:41.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://more-itertools.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/more-itertools.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-04-26T05:15:14.000Z","updated_at":"2026-04-01T21:02:15.000Z","dependencies_parsed_at":"2025-12-12T02:05:35.336Z","dependency_job_id":null,"html_url":"https://github.com/more-itertools/more-itertools","commit_stats":{"total_commits":1367,"total_committers":126,"mean_commits":10.84920634920635,"dds":0.4667154352596927,"last_synced_commit":"f36c88fe03688fa442154ef14f429bcfa4c38525"},"previous_names":["erikrose/more-itertools"],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/more-itertools/more-itertools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/more-itertools%2Fmore-itertools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/more-itertools%2Fmore-itertools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/more-itertools%2Fmore-itertools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/more-itertools%2Fmore-itertools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/more-itertools","download_url":"https://codeload.github.com/more-itertools/more-itertools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/more-itertools%2Fmore-itertools/sbom","scorecard":{"id":316917,"data":{"date":"2025-08-11","repo":{"name":"github.com/more-itertools/more-itertools","commit":"030a6c62daaf91c5a40ca3e93039a51a1c0840ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.6,"checks":[{"name":"Code-Review","score":6,"reason":"Found 4/6 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 20 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/more-itertools/more-itertools/python-app.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/more-itertools/more-itertools/python-app.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/more-itertools/more-itertools/python-app.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-app.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: OSSFuzz integration found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v10.7.0 not signed: https://api.github.com/repos/more-itertools/more-itertools/releases/213951116","Warn: release artifact v10.6.0 not signed: https://api.github.com/repos/more-itertools/more-itertools/releases/194721353","Warn: release artifact v10.4.0 not signed: https://api.github.com/repos/more-itertools/more-itertools/releases/169117491","Warn: release artifact v10.3.0 not signed: https://api.github.com/repos/more-itertools/more-itertools/releases/159683586","Warn: release artifact v10.7.0 does not have provenance: https://api.github.com/repos/more-itertools/more-itertools/releases/213951116","Warn: release artifact v10.6.0 does not have provenance: https://api.github.com/repos/more-itertools/more-itertools/releases/194721353","Warn: release artifact v10.4.0 does not have provenance: https://api.github.com/repos/more-itertools/more-itertools/releases/169117491","Warn: release artifact v10.3.0 does not have provenance: https://api.github.com/repos/more-itertools/more-itertools/releases/159683586"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T00:24:47.047Z","repository_id":3117564,"created_at":"2025-08-18T00:24:47.047Z","updated_at":"2025-08-18T00:24:47.047Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31319740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T23:57:25.032Z","status":"ssl_error","status_checked_at":"2026-04-02T23:57:06.281Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:01:16.720Z","updated_at":"2026-04-03T00:01:35.094Z","avatar_url":"https://github.com/more-itertools.png","language":"Python","readme":"==============\nMore Itertools\n==============\n\n.. image:: https://readthedocs.org/projects/more-itertools/badge/?version=latest\n  :target: https://more-itertools.readthedocs.io/en/stable/\n\nPython's ``itertools`` library is a gem - you can compose elegant solutions\nfor a variety of problems with the functions it provides. In ``more-itertools``\nwe collect additional building blocks, recipes, and routines for working with\nPython iterables.\n\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Grouping               | `chunked \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.chunked\u003e`_,                                                                               |\n|                        | `ichunked \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ichunked\u003e`_,                                                                             |\n|                        | `chunked_even \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.chunked_even\u003e`_,                                                                     |\n|                        | `sliced \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sliced\u003e`_,                                                                                 |\n|                        | `constrained_batches \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.constrained_batches\u003e`_,                                                       |\n|                        | `distribute \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.distribute\u003e`_,                                                                         |\n|                        | `divide \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.divide\u003e`_,                                                                                 |\n|                        | `split_at \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_at\u003e`_,                                                                             |\n|                        | `split_before \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_before\u003e`_,                                                                     |\n|                        | `split_after \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_after\u003e`_,                                                                       |\n|                        | `split_into \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_into\u003e`_,                                                                         |\n|                        | `split_when \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_when\u003e`_,                                                                         |\n|                        | `bucket \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.bucket\u003e`_,                                                                                 |\n|                        | `unzip \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unzip\u003e`_,                                                                                   |\n|                        | `batched \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.batched\u003e`_,                                                                               |\n|                        | `grouper \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.grouper\u003e`_,                                                                               |\n|                        | `partition \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.partition\u003e`_                                                                            |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Lookahead and lookback | `spy \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.spy\u003e`_,                                                                                       |\n|                        | `peekable \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.peekable\u003e`_,                                                                             |\n|                        | `seekable \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.seekable\u003e`_                                                                              |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Windowing              | `windowed \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.windowed\u003e`_,                                                                             |\n|                        | `substrings \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.substrings\u003e`_,                                                                         |\n|                        | `substrings_indexes \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.substrings_indexes\u003e`_,                                                         |\n|                        | `stagger \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.stagger\u003e`_,                                                                               |\n|                        | `windowed_complete \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.windowed_complete\u003e`_,                                                           |\n|                        | `pairwise \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pairwise\u003e`_,                                                                             |\n|                        | `triplewise \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.triplewise\u003e`_,                                                                         |\n|                        | `sliding_window \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sliding_window\u003e`_,                                                                 |\n|                        | `subslices \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.subslices\u003e`_                                                                            |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Augmenting             | `count_cycle \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.count_cycle\u003e`_,                                                                       |\n|                        | `intersperse \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.intersperse\u003e`_,                                                                       |\n|                        | `padded \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.padded\u003e`_,                                                                                 |\n|                        | `repeat_each \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.repeat_each\u003e`_,                                                                       |\n|                        | `mark_ends \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.mark_ends\u003e`_,                                                                           |\n|                        | `repeat_last \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.repeat_last\u003e`_,                                                                       |\n|                        | `adjacent \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.adjacent\u003e`_,                                                                             |\n|                        | `groupby_transform \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.groupby_transform\u003e`_,                                                           |\n|                        | `pad_none \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pad_none\u003e`_,                                                                             |\n|                        | `ncycles \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ncycles\u003e`_                                                                                |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Combining              | `collapse \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.collapse\u003e`_,                                                                             |\n|                        | `sort_together \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sort_together\u003e`_,                                                                   |\n|                        | `interleave \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.interleave\u003e`_,                                                                         |\n|                        | `interleave_longest \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.interleave_longest\u003e`_,                                                         |\n|                        | `interleave_evenly \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.interleave_evenly\u003e`_,                                                           |\n|                        | `interleave_randomly \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.interleave_randomly\u003e`_,                                                       |\n|                        | `zip_offset \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.zip_offset\u003e`_,                                                                         |\n|                        | `zip_broadcast \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.zip_broadcast\u003e`_,                                                                   |\n|                        | `flatten \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.flatten\u003e`_,                                                                               |\n|                        | `roundrobin \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.roundrobin\u003e`_,                                                                         |\n|                        | `prepend \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.prepend\u003e`_,                                                                               |\n|                        | `value_chain \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.value_chain\u003e`_,                                                                       |\n|                        | `partial_product \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.partial_product\u003e`_                                                                |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Concurrency            | `concurrent_tee \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.concurrent_tee\u003e`_,                                                                 |\n|                        | `serialize \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.serialize\u003e`_,                                                                           |\n|                        | `synchronized \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.synchronized\u003e`_                                                                      |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Summarizing            | `ilen \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ilen\u003e`_,                                                                                     |\n|                        | `unique_to_each \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_to_each\u003e`_,                                                                 |\n|                        | `sample \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sample\u003e`_,                                                                                 |\n|                        | `consecutive_groups \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.consecutive_groups\u003e`_,                                                         |\n|                        | `run_length \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.run_length\u003e`_,                                                                         |\n|                        | `map_reduce \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.map_reduce\u003e`_,                                                                         |\n|                        | `join_mappings \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.join_mappings\u003e`_,                                                                   |\n|                        | `exactly_n \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.exactly_n\u003e`_,                                                                           |\n|                        | `is_sorted \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.is_sorted\u003e`_,                                                                           |\n|                        | `all_equal \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.all_equal\u003e`_,                                                                           |\n|                        | `all_unique \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.all_unique\u003e`_,                                                                         |\n|                        | `argmin \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.argmin\u003e`_,                                                                                 |\n|                        | `argmax \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.argmax\u003e`_,                                                                                 |\n|                        | `minmax \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.minmax\u003e`_,                                                                                 |\n|                        | `first_true \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.first_true\u003e`_,                                                                         |\n|                        | `quantify \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.quantify\u003e`_,                                                                             |\n|                        | `iequals \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iequals\u003e`_                                                                                |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Selecting              | `islice_extended \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.islice_extended\u003e`_,                                                               |\n|                        | `first \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.first\u003e`_,                                                                                   |\n|                        | `last \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.last\u003e`_,                                                                                     |\n|                        | `one \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.one\u003e`_,                                                                                       |\n|                        | `only \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.only\u003e`_,                                                                                     |\n|                        | `strictly_n \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.strictly_n\u003e`_,                                                                         |\n|                        | `strip \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.strip\u003e`_,                                                                                   |\n|                        | `lstrip \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.lstrip\u003e`_,                                                                                 |\n|                        | `rstrip \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.rstrip\u003e`_,                                                                                 |\n|                        | `filter_except \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.filter_except\u003e`_,                                                                   |\n|                        | `map_except \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.map_except\u003e`_,                                                                         |\n|                        | `filter_map \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.filter_map\u003e`_,                                                                         |\n|                        | `iter_suppress \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iter_suppress\u003e`_,                                                                   |\n|                        | `nth_or_last \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_or_last\u003e`_,                                                                       |\n|                        | `extract \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.extract\u003e`_,                                                                               |\n|                        | `unique_in_window \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_in_window\u003e`_,                                                             |\n|                        | `before_and_after \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.before_and_after\u003e`_,                                                             |\n|                        | `nth \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth\u003e`_,                                                                                       |\n|                        | `take \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.take\u003e`_,                                                                                     |\n|                        | `tail \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tail\u003e`_,                                                                                     |\n|                        | `unique_everseen \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_everseen\u003e`_,                                                               |\n|                        | `unique_justseen \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_justseen\u003e`_,                                                               |\n|                        | `unique \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique\u003e`_,                                                                                 |\n|                        | `duplicates_everseen \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.duplicates_everseen\u003e`_,                                                       |\n|                        | `duplicates_justseen \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.duplicates_justseen\u003e`_,                                                       |\n|                        | `classify_unique \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.classify_unique\u003e`_,                                                               |\n|                        | `longest_common_prefix \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.longest_common_prefix\u003e`_,                                                   |\n|                        | `takewhile_inclusive \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.takewhile_inclusive\u003e`_                                                        |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Math                   | `dft \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dft\u003e`_,                                                                                       |\n|                        | `idft \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.idft\u003e`_,                                                                                     |\n|                        | `convolve \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.convolve\u003e`_,                                                                             |\n|                        | `dotproduct \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dotproduct\u003e`_,                                                                         |\n|                        | `matmul \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.matmul\u003e`_,                                                                                 |\n|                        | `polynomial_from_roots \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.polynomial_from_roots\u003e`_,                                                   |\n|                        | `polynomial_derivative \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.polynomial_derivative\u003e`_,                                                   |\n|                        | `polynomial_eval \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.polynomial_eval\u003e`_,                                                               |\n|                        | `reshape \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.reshape\u003e`_,                                                                               |\n|                        | `sum_of_squares \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sum_of_squares\u003e`_,                                                                 |\n|                        | `transpose \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.transpose\u003e`_                                                                            |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Integer math           | `factor \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.factor\u003e`_,                                                                                 |\n|                        | `is_prime \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.is_prime\u003e`_,                                                                             |\n|                        | `multinomial \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.multinomial\u003e`_,                                                                       |\n|                        | `nth_prime \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_prime\u003e`_,                                                                           |\n|                        | `sieve \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sieve\u003e`_,                                                                                   |\n|                        | `totient \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.totient\u003e`_                                                                                |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Statistics             | `running_min \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.running_min\u003e`_,                                                                       |\n|                        | `running_max \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.running_max\u003e`_,                                                                       |\n|                        | `running_mean \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.running_mean\u003e`_,                                                                     |\n|                        | `running_median \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.running_median\u003e`_,                                                                 |\n|                        | `running_statistics \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.running_statistics\u003e`_                                                          |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Combinatorics          | `circular_shifts \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.circular_shifts\u003e`_,                                                               |\n|                        | `derangements \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.derangements\u003e`_,                                                                     |\n|                        | `gray_product  \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.gray_product\u003e`_,                                                                    |\n|                        | `outer_product  \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.outer_product\u003e`_,                                                                  |\n|                        | `partitions \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.partitions\u003e`_,                                                                         |\n|                        | `set_partitions \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.set_partitions\u003e`_,                                                                 |\n|                        | `powerset \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.powerset\u003e`_,                                                                             |\n|                        | `powerset_of_sets \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.powerset_of_sets\u003e`_                                                              |\n|                        +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n|                        | `distinct_combinations \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.distinct_combinations\u003e`_,                                                   |\n|                        | `distinct_permutations \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.distinct_permutations\u003e`_                                                    |\n|                        +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n|                        | `combination_index \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.combination_index\u003e`_,                                                           |\n|                        | `combination_with_replacement_index \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.combination_with_replacement_index\u003e`_,                         |\n|                        | `permutation_index \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.permutation_index\u003e`_,                                                           |\n|                        | `product_index \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.product_index\u003e`_                                                                    |\n|                        +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n|                        | `nth_combination \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_combination\u003e`_,                                                               |\n|                        | `nth_combination_with_replacement \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_combination_with_replacement\u003e`_,                             |\n|                        | `nth_permutation \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_permutation\u003e`_,                                                               |\n|                        | `nth_product \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_product\u003e`_                                                                        |\n|                        +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n|                        | `random_combination \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_combination\u003e`_,                                                         |\n|                        | `random_combination_with_replacement \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_combination_with_replacement\u003e`_,                       |\n|                        | `random_derangement \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_derangement\u003e`_,                                                         |\n|                        | `random_permutation \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_permutation\u003e`_,                                                         |\n|                        | `random_product \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_product\u003e`_                                                                  |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Wrapping               | `always_iterable \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.always_iterable\u003e`_,                                                               |\n|                        | `always_reversible \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.always_reversible\u003e`_,                                                           |\n|                        | `countable \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.countable\u003e`_,                                                                           |\n|                        | `consumer \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.consumer\u003e`_,                                                                             |\n|                        | `iter_except \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iter_except\u003e`_,                                                                       |\n|                        | `sized_iterator \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sized_iterator\u003e`_                                                                  |\n|                        | `with_iter \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.with_iter\u003e`_                                                                            |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Others                 | `locate \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.locate\u003e`_,                                                                                 |\n|                        | `rlocate \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.rlocate\u003e`_,                                                                               |\n|                        | `replace \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.replace\u003e`_,                                                                               |\n|                        | `numeric_range \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.numeric_range\u003e`_,                                                                   |\n|                        | `side_effect \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.side_effect\u003e`_,                                                                       |\n|                        | `iterate \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iterate\u003e`_,                                                                               |\n|                        | `loops \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.loops\u003e`_,                                                                                   |\n|                        | `difference \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.difference\u003e`_,                                                                         |\n|                        | `make_decorator \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.make_decorator\u003e`_,                                                                 |\n|                        | `SequenceView \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.SequenceView\u003e`_,                                                                     |\n|                        | `time_limited \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.time_limited\u003e`_,                                                                     |\n|                        | `map_if \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.map_if\u003e`_,                                                                                 |\n|                        | `iter_index \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iter_index\u003e`_,                                                                         |\n|                        | `consume \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.consume\u003e`_,                                                                               |\n|                        | `tabulate \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tabulate\u003e`_,                                                                             |\n|                        | `repeatfunc \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.repeatfunc\u003e`_,                                                                         |\n|                        | `doublestarmap \u003chttps://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.doublestarmap\u003e`_                                                                    |\n+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n\n\nGetting started\n===============\n\nTo get started, install the library with `pip \u003chttps://pip.pypa.io/en/stable/\u003e`_:\n\n.. code-block:: shell\n\n    pip install more-itertools\n\nThe recipes from the `itertools docs \u003chttps://docs.python.org/3/library/itertools.html#itertools-recipes\u003e`_\nare included in the top-level package:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from more_itertools import flatten\n    \u003e\u003e\u003e iterable = [(0, 1), (2, 3)]\n    \u003e\u003e\u003e list(flatten(iterable))\n    [0, 1, 2, 3]\n\nSeveral new recipes are available as well:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from more_itertools import chunked\n    \u003e\u003e\u003e iterable = [0, 1, 2, 3, 4, 5, 6, 7, 8]\n    \u003e\u003e\u003e list(chunked(iterable, 3))\n    [[0, 1, 2], [3, 4, 5], [6, 7, 8]]\n\n    \u003e\u003e\u003e from more_itertools import spy\n    \u003e\u003e\u003e iterable = (x * x for x in range(1, 6))\n    \u003e\u003e\u003e head, iterable = spy(iterable, n=3)\n    \u003e\u003e\u003e list(head)\n    [1, 4, 9]\n    \u003e\u003e\u003e list(iterable)\n    [1, 4, 9, 16, 25]\n\n\n\nFor the full listing of functions, see the `API documentation \u003chttps://more-itertools.readthedocs.io/en/stable/api.html\u003e`_.\n\n\nLinks elsewhere\n===============\n\nBlog posts about ``more-itertools``:\n\n* `Yo, I heard you like decorators \u003chttps://www.bbayles.com/index/decorator_factory\u003e`__\n* `Tour of Python Itertools \u003chttps://martinheinz.dev/blog/16\u003e`__ (`Alternate \u003chttps://dev.to/martinheinz/tour-of-python-itertools-4122\u003e`__)\n* `Real-World Python More Itertools \u003chttps://python.plainenglish.io/real-world-more-itertools-gideons-blog-a3901c607550\u003e`_\n\n\nDevelopment\n===========\n\n``more-itertools`` is maintained by `@erikrose \u003chttps://github.com/erikrose\u003e`_\nand `@bbayles \u003chttps://github.com/bbayles\u003e`_, with help from `many others \u003chttps://github.com/more-itertools/more-itertools/graphs/contributors\u003e`_.\nIf you have a problem or suggestion, please file a bug or pull request in this\nrepository. Thanks for contributing!\n\n\nVersion History\n===============\n\nThe version history can be found in `documentation \u003chttps://more-itertools.readthedocs.io/en/stable/versions.html\u003e`_.\n","funding_links":[],"categories":["Python","Containers \u0026 Language Extentions \u0026 Linting","函数式编程","General Utilities"],"sub_categories":["For Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmore-itertools%2Fmore-itertools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmore-itertools%2Fmore-itertools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmore-itertools%2Fmore-itertools/lists"}