# PyIter
[![Pypi version](https://img.shields.io/pypi/v/pyiter?style=for-the-badge)](https://pypi.org/project/pyiter/)
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
```bash
pip install pyiter
```
## Quickstart
```python
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**
![.](https://github.com/mokeyish/pyiter/raw/main/screenshots/screenshot.png)
## API
See [API](https://pyiter.yish.org/pyiter/sequence.html) documention.
- You no need to read API documention. all functions are listed by the code completion as follows.
![.](https://github.com/mokeyish/pyiter/raw/main/screenshots/apilist.png)
- All documentions are showed as follows.
![.](https://github.com/mokeyish/pyiter/raw/main/screenshots/apidoc.png)
## Similar libraries
Note that none of the following libraries are providing full strong typing for code completion.
- [Pyterator](https://github.com/remykarem/pyterator)
- [PyFunctional](https://github.com/EntilZha/PyFunctional)
- [fluent](https://github.com/dwt/fluent)
- [Simple Smart Pipe](https://github.com/sspipe/sspipe)
- [pyxtension](https://github.com/asuiu/pyxtension)
## License
Licensed under either of
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/mokeyish/pyiter",
"name": "pyiter",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "linq, iterator, typing, lazy evaluation, type inference",
"author": "YISH",
"author_email": "mokeyish@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/97/22/6bb90e79bc52ac5ed020a6df0b0e26d615ba593788edd3673fe6337f8a5f/pyiter-0.13.2.tar.gz",
"platform": null,
"description": "# PyIter\n\n[![Pypi version](https://img.shields.io/pypi/v/pyiter?style=for-the-badge)](https://pypi.org/project/pyiter/)\n\nPyIter is a Python package for iterative operations inspired by the Kotlin\u3001CSharp(linq)\u3001TypeSrcipt and Rust .\nEnables strong **typing** and type inference for iterative operations.\n\n- Chain operations like map, reduce, filter, map\n- Lazy evaluation\n- parallel execution\n- strong **typing**\n\n## Install\n\n```bash\npip install pyiter\n```\n\n## Quickstart\n\n```python\nfrom pyiter import it\nfrom tqdm import tqdm\n\n\ntext = [\"hello\", \"world\"]\nit(text).map(str.upper).to_list()\n# ['HELLO', 'WORLD']\n\n\nwords = 'I dont want to believe I want to know'.split()\nit(words).group_by(lambda x: x).map(lambda g: (g.key, g.values.count())).to_list()\n# [('I', 2), ('dont', 1), ('want', 2), ('to', 2), ('believe', 1), ('know', 1)]\n\n\n# use tqdm\nit(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()\n\n```\n\n\n**Type inference**\n![.](https://github.com/mokeyish/pyiter/raw/main/screenshots/screenshot.png)\n\n## API\n\nSee [API](https://pyiter.yish.org/pyiter/sequence.html) documention.\n\n- You no need to read API documention. all functions are listed by the code completion as follows.\n \n ![.](https://github.com/mokeyish/pyiter/raw/main/screenshots/apilist.png)\n\n- All documentions are showed as follows.\n\n ![.](https://github.com/mokeyish/pyiter/raw/main/screenshots/apidoc.png)\n\n## Similar libraries\n\nNote that none of the following libraries are providing full strong typing for code completion.\n\n- [Pyterator](https://github.com/remykarem/pyterator)\n- [PyFunctional](https://github.com/EntilZha/PyFunctional)\n- [fluent](https://github.com/dwt/fluent)\n- [Simple Smart Pipe](https://github.com/sspipe/sspipe)\n- [pyxtension](https://github.com/asuiu/pyxtension)\n\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)\n\nat your option.\n\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "PyIter is a Python package for iterative operations inspired by the Kotlin\u3001CSharp(linq)\u3001TypeSrcipt and Rust . Enables strong typing and type inference for iterative operations.",
"version": "0.13.2",
"project_urls": {
"Homepage": "https://github.com/mokeyish/pyiter"
},
"split_keywords": [
"linq",
" iterator",
" typing",
" lazy evaluation",
" type inference"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9acbf4694246734edb78b8717dce85ca76ee3740f8c45332078624a73c51b9a6",
"md5": "60fe5403b7577dc2c7d32a2c6e54411c",
"sha256": "504cfa4d02920cae1c3f68e24250589fa432fbcb0d5cfe5266a01f1c33828a40"
},
"downloads": -1,
"filename": "pyiter-0.13.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "60fe5403b7577dc2c7d32a2c6e54411c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 31655,
"upload_time": "2024-12-05T12:32:14",
"upload_time_iso_8601": "2024-12-05T12:32:14.281315Z",
"url": "https://files.pythonhosted.org/packages/9a/cb/f4694246734edb78b8717dce85ca76ee3740f8c45332078624a73c51b9a6/pyiter-0.13.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "97226bb90e79bc52ac5ed020a6df0b0e26d615ba593788edd3673fe6337f8a5f",
"md5": "bfe32dc5eb7becf17b0ebc4d8c461db9",
"sha256": "a11914e31ae233777593d863d87f93f55dbcd48677c96de52839a4b612b99571"
},
"downloads": -1,
"filename": "pyiter-0.13.2.tar.gz",
"has_sig": false,
"md5_digest": "bfe32dc5eb7becf17b0ebc4d8c461db9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 26297,
"upload_time": "2024-12-05T12:32:16",
"upload_time_iso_8601": "2024-12-05T12:32:16.283407Z",
"url": "https://files.pythonhosted.org/packages/97/22/6bb90e79bc52ac5ed020a6df0b0e26d615ba593788edd3673fe6337f8a5f/pyiter-0.13.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-05 12:32:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mokeyish",
"github_project": "pyiter",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyiter"
}