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.13.9.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

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

pyiter-0.13.9-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyiter-0.13.9.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for pyiter-0.13.9.tar.gz
Algorithm Hash digest
SHA256 293f8b3535d956ab63bb7f3120ced573782022a1e195aa61b062d247f5fcc1b7
MD5 3ff2c33c7b1f9941d18b9ec1ed94265e
BLAKE2b-256 8ca20d280ead82f1b2f9dd3b369a5f4b7e18affb693190f26ec58f9c60c55788

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyiter-0.13.9-py3-none-any.whl
  • Upload date:
  • Size: 51.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for pyiter-0.13.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d0232bcf7c877e367221456a8417d0691f1705ded4c15ab4ea4fcdfb48267339
MD5 76c4b71fa3727b1285b6429c6496d0a0
BLAKE2b-256 b381b5176a13770217fb5e0ea18c8a7c1ffcf9a17a9c74fd0f9b1fc8028fa59c

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