Skip to main content

PyIter is a Python package for iterative operations inspired by the Kotlin、CSharp(linq)、TypeSrcipt and Rust . Enables strong typing and type inference for iterative operations.

Project description

PyIter

Pypi version

PyIter is a Python package for iterative operations inspired by the Kotlin、CSharp(linq)、TypeSrcipt and Rust . Enables strong typing and type inference for iterative operations.

  • Chain operations like map, reduce, filter, map
  • Lazy evaluation
  • parallel execution
  • strong typing

Install

pip install pyiter

Quickstart

from pyiter import it
from tqdm import tqdm


text = ["hello", "world"]
it(text).map(str.upper).to_list()
# ['HELLO', 'WORLD']


words = 'I dont want to believe I want to know'.split()
it(words).group_by(lambda x: x).map(lambda g: (g.key, g.values.count())).to_list()
# [('I', 2), ('dont', 1), ('want', 2), ('to', 2), ('believe', 1), ('know', 1)]


# use tqdm
it(range(10)).map(lambda x: str(x)).progress(lambda x: tqdm(x, total=x.len)).parallel_map(lambda x: x, max_workers=5).to_list()

Type inference .

API

See API documention.

  • You no need to read API documention. all functions are listed by the code completion as follows.

    .

  • All documentions are showed as follows.

    .

Similar libraries

Note that none of the following libraries are providing full strong typing for code completion.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

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

pyiter-0.9.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

pyiter-0.9.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file pyiter-0.9.1.tar.gz.

File metadata

  • Download URL: pyiter-0.9.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pyiter-0.9.1.tar.gz
Algorithm Hash digest
SHA256 050fcbdd1e364d73e0c40cf0d3ea3237c36b485d2d5b66e769eb67db67c7aa65
MD5 dd61f15d6bb9f4e00eef42bc2ee076c1
BLAKE2b-256 1791e995ae894d124b30dfa809e66223d59661022009bbc5cd506f77a477d92b

See more details on using hashes here.

File details

Details for the file pyiter-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: pyiter-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pyiter-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d50d694c62bbd2eacfff12e769f40b8d42b906ba14a9ddc0f65b3005b6191fc
MD5 107bc1cbc9f00004b2dfd4f78b04139a
BLAKE2b-256 c5eb559a17c2a6704d005e8411f8bdb590a77945f6d3add2efd11dfd487f9c09

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