Skip to main content

iterplus provides functionality that extends itertools

Project description

iterplus - itertools extended

This library provides a set of functions that complement Python itertools. These include means to access iterable content via slicing, scan generator (easy series) and chainable wrapper (ie. a.map(…).filter(…)).

Examples

Scan

fibo = scan(0, 1, lambda a, b: a + b)

“scan” returns an iterator. Note how simple it’s to define series such as Fibonacci’s using it. In case an explicit rule is not provided, it infers one automatically (ie. 1,2,3,…).

Sliceable

sliceable(scan(0, 1))[2:5] # returns list containing third, fourth and fifth item

“sliceable” makes it possible to slice the content of iterators.

Chainable

chainable([1, 2, 3]).map(lambda x: x * 2).filter(lambda x: x > 3).val() == [4, 6]

“chainable” makes it possible to use basic functional utilities (map, filter, reduce) using a chaining syntax.

License

iterplus is available under MIT license. See LICENSE for more details.

Changelog

0.2.5 (2011-11-16)

  • Added index and rindex

  • Tidied up docs

0.2.0 (2011-11-11)

  • First public release

  • Added caching to sliceable

0.1.0 (2011-09-26)

  • Initial release

Project details


Download files

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

Source Distribution

iterplus-0.2.5.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file iterplus-0.2.5.tar.gz.

File metadata

  • Download URL: iterplus-0.2.5.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for iterplus-0.2.5.tar.gz
Algorithm Hash digest
SHA256 acf1a70b9895f55a20fbaf2271789ce86460cd4869dc621fbe53e654a786d688
MD5 866b62fe669a35ca96c4e88a86070d9b
BLAKE2b-256 b27a9f1d8266eb0d56031676aeefe941ade045dcfdfe608b7441ac64726c516c

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