Skip to main content

iters

License Version Downloads Discord

Documentation Check Test Coverage

Composable external iteration.

If you have found yourself with a collection of some kind, and needed to perform an operation on the elements of said collection, you will quickly run into iterators. Iterators are heavily used in idiomatic Python code, so becoming familiar with them is essential.

Installing

Python 3.8 or above is required.

pip

Installing the library with pip is quite simple:

$ pip install iters

Alternatively, the library can be installed from source:

$ git clone https://github.com/nekitdev/iters.git
$ cd iters
$ python -m pip install .

poetry

You can add iters as a dependency with the following command:

$ poetry add iters

Or by directly specifying it in the configuration like so:

[tool.poetry.dependencies]
iters = "^0.18.0"

Alternatively, you can add it directly from the source:

[tool.poetry.dependencies.iters]
git = "https://github.com/nekitdev/iters.git"

Examples

Simple

Squaring only even numbers in some sequence:

from iters import iter


def is_even(value: int) -> bool:
    return not value % 2


def square(value: int) -> int:
    return value * value


numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

result = iter(numbers).filter(is_even).map(square).list()

print(result)  # [0, 4, 16, 36, 64]

Asynchronous

Asynchronous iteration is fully supported by iters, and its API is similar to its synchronous counterpart.

Documentation

You can find the documentation here.

Support

If you need support with the library, you can send an email or refer to the official Discord server.

Changelog

You can find the changelog here.

Security Policy

You can find the Security Policy of iters here.

Contributing

If you are interested in contributing to iters, make sure to take a look at the Contributing Guide, as well as the Code of Conduct.

License

iters is licensed under the MIT License terms. See License for details.

Metadata

Release files for iters 0.18.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iters 0.18.0
File Size Uploaded
iters-0.18.0.tar.gz 54.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iters 0.18.0
File Interpreter ABI Platform
iters-0.18.0-py3-none-any.whl Python 3 none any Details

Total release size: 112.6 kB

Release files / iters-0.18.0.tar.gz

Download URL iters-0.18.0.tar.gz
Size 54.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a4675193c8c0d60d7cca7e97c0eea588d37b586df268346070e0550d978fdb55
BLAKE2b-256 checksum
How to use checksums
6b0645ff764cfcd3ab7e9f60127cca16f931204d54d4925bf6592bd5dd2dde89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1018-azure

Release files / iters-0.18.0-py3-none-any.whl

Download URL iters-0.18.0-py3-none-any.whl
Size 57.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
932eec3100eed3768699401983c3ca254bde1b0cf09aa9e452d5f063719d8654
BLAKE2b-256 checksum
How to use checksums
215fd11beae693356c6c4bbe11eb45ff5c5b380e906f338116ddd46a1708560a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1018-azure

Release history Release notifications | RSS feed

This release

0.18.0 This release

2 release files

0.17.0

2 release files

0.16.3

2 release files

0.16.2

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page