Skip to main content

Modern Python iterators.

Project description

Eaterate

GitHubDocs

Eaterate (eet-uh-rate) is a toolkit of modern Python iterators. Or whatever the hell you wanna call this.

Key features:

  • Fully typed. C'mon, type annotations are just essential these days.
  • Quick protyping. Just chain everything.
  • Flexible. Build your custom iterators.
from eaterate import eater

eat = eater("hi!").enumerate()

for index, char in eat:
    print(index, char)

# Output:
# 0 h
# 1 i
# 2 !

Quick tour

With eaterate, you can use iterators in the easiest way possible:

eat = (
    eater([1, 2])
    .chain([4, 5])
    .map(lambda i: i * 2)
)

# collects to a list
print(eat.collect(list))

# [2, 4, 8, 10]

You can also add separators to your iterator like never before (kind of):

eat = eater([1, 2, 3]).intersperse(500)
for i in eat:
    print(i)

# Output:
# 1
# 500
# 2
# 500
# 3

There are a lot more features to try out! Refer to the Core API reference for more!

Architecture

Instead of raising StopIteration (exception-like) when an iterator ends, eaterate uses value wrappers, specifically Option[T].

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

eaterate-0.2.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eaterate-0.2.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file eaterate-0.2.0.tar.gz.

File metadata

  • Download URL: eaterate-0.2.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for eaterate-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0e8ee63ec502629b8a0d190ad167db826e8db4900e9d43aeab8a82f2bb962b62
MD5 026e3521fa203ee9a37d0c2aa7699db8
BLAKE2b-256 d3c15276e6f17f2f881df33ebfc0d771c97997bd56ce70eb0531bd32666d2b03

See more details on using hashes here.

File details

Details for the file eaterate-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: eaterate-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for eaterate-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c495840b5c724b0b7b271dd19ea8387532a7becc44943f2dbbbd543b1b2dabbb
MD5 6b9ad37dea2c5ddad50356a35897de41
BLAKE2b-256 5243f9c4b36c71c354d5e0029bdf09b992cf4566813957fcfdc12f3306060715

See more details on using hashes here.

Supported by

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