Skip to main content

iter-model uses a method approach instead of individual functions to work with iterable objects.

Project description

IterModel

Supported Python versions Package version Test

Supported Versions Supported Versions Supported Versions Supported Versions


iter_model - provides a convenient API for interacting with iterable objects (Iterable). iter_model uses a methods approach instead of individual functions.

iter_model also provides async analog of all methods. This is useful when interacting with asynchronous iterable objects (AsyncIterable), because python does not have ready functions for these cases.

Therefore, iter_model provides SyncIter class for Iterable, and AsyncIter for AsyncIterable.


Example

from iter_model import SyncIter

it = SyncIter(range(10))  # SyncIter for sync iterables
result = (
    it.where(lambda x: x % 2 == 0)  # filter only odd values
    .take(3)  # take first 3 value
    .map(lambda x: x ** 2)  # square all values
)
print(result.to_list())

Links

Source code: github.com/VolodymyrBor/iter_model

Documentation: iter_model

Changelog: changelog

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

iter_model-4.0.5.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

iter_model-4.0.5-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file iter_model-4.0.5.tar.gz.

File metadata

  • Download URL: iter_model-4.0.5.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.10.19 Linux/6.14.0-1017-azure

File hashes

Hashes for iter_model-4.0.5.tar.gz
Algorithm Hash digest
SHA256 2edf171db3ecf4c293fce5aa58e28d3f705ba2b437acbeada67790182b7b0874
MD5 f5d3b4efc4457a3cf4d93c564c20f85b
BLAKE2b-256 07cc45fd30cda31a34a427f2077e17c44aff78367600d46b65ed559e74eb4efd

See more details on using hashes here.

File details

Details for the file iter_model-4.0.5-py3-none-any.whl.

File metadata

  • Download URL: iter_model-4.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.10.19 Linux/6.14.0-1017-azure

File hashes

Hashes for iter_model-4.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 13a7d94f4bd631e2b72a5d929bc01f898c8c2ed713151942e28bfa70431b832f
MD5 ac85964722e4ad886f0b5c534a1c2817
BLAKE2b-256 c20e6130f2a5310526d24f9c7fdd152482d6cc1f8b9c584efb9a8fe38dd4f428

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