iter_model


Nameiter_model JSON
Version 3.0.0 PyPI version JSON
download
home_pagehttps://volodymyrbor.github.io/iter_model/
Summaryiter-model uses a method approach instead of individual functions to work with iterable objects.
upload_time2024-06-27 19:56:08
maintainerNone
docs_urlNone
authorvolodymyrb
requires_python<4.0,>=3.10
licenseMIT
keywords iterator iterable async
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
    <a href="https://volodymyrbor.github.io/iter_model">
        <img src="https://volodymyrbor.github.io/iter_model/img/iter_model-logos_transparent.png" alt="IterModel" width="300">
    </a>
</p>


<a href="https://pypi.org/project/iter_model" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/iter_model.svg?color=%2334D058" alt="Supported Python versions">
</a>
<a href="https://pypi.org/project/iter_model" target="_blank">
    <img src="https://img.shields.io/pypi/v/iter_model?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://github.com/VolodymyrBor/iter_model/actions/workflows/build.yml?branch=master" target="_blank">
    <img src="https://github.com/VolodymyrBor/iter_model/actions/workflows/build.yml/badge.svg?branch=master" alt="Test">
</a>

[![Supported Versions](https://img.shields.io/badge/coverage-100%25-green)](https://shields.io/)
[![Supported Versions](https://img.shields.io/badge/poetry-✅-grey)](https://shields.io/)
[![Supported Versions](https://img.shields.io/badge/async-✅-grey)](https://shields.io/)
[![Supported Versions](https://img.shields.io/badge/mypy-✅-grey)](https://shields.io/)

---

**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

```python
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](https://github.com/VolodymyrBor/iter_model)

**Documentation**: [iter_model](https://volodymyrbor.github.io/iter_model/)

**Changelog**: [changelog](https://volodymyrbor.github.io/iter_model/changelog)

[Iterable]: https://docs.python.org/3/library/typing.html#typing.Iterable
[AsyncIterable]: https://docs.python.org/3/library/typing.html#typing.AsyncIterable

            

Raw data

            {
    "_id": null,
    "home_page": "https://volodymyrbor.github.io/iter_model/",
    "name": "iter_model",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "iterator, iterable, async",
    "author": "volodymyrb",
    "author_email": "volodymyr.borysiuk0@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/3b/a25246a796bff54c2f50d7c110c08c26ee4d3bfd6cef1000dc57652e7694/iter_model-3.0.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n    <a href=\"https://volodymyrbor.github.io/iter_model\">\n        <img src=\"https://volodymyrbor.github.io/iter_model/img/iter_model-logos_transparent.png\" alt=\"IterModel\" width=\"300\">\n    </a>\n</p>\n\n\n<a href=\"https://pypi.org/project/iter_model\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/pyversions/iter_model.svg?color=%2334D058\" alt=\"Supported Python versions\">\n</a>\n<a href=\"https://pypi.org/project/iter_model\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/v/iter_model?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n</a>\n<a href=\"https://github.com/VolodymyrBor/iter_model/actions/workflows/build.yml?branch=master\" target=\"_blank\">\n    <img src=\"https://github.com/VolodymyrBor/iter_model/actions/workflows/build.yml/badge.svg?branch=master\" alt=\"Test\">\n</a>\n\n[![Supported Versions](https://img.shields.io/badge/coverage-100%25-green)](https://shields.io/)\n[![Supported Versions](https://img.shields.io/badge/poetry-\u2705-grey)](https://shields.io/)\n[![Supported Versions](https://img.shields.io/badge/async-\u2705-grey)](https://shields.io/)\n[![Supported Versions](https://img.shields.io/badge/mypy-\u2705-grey)](https://shields.io/)\n\n---\n\n**iter_model** - provides a convenient API for interacting with iterable objects ([Iterable]).\niter_model uses a methods approach instead of individual functions.\n\niter_model also provides **async** analog of all methods. \nThis is useful when interacting with asynchronous iterable objects ([AsyncIterable]), \nbecause python does not have ready functions for these cases.\n\nTherefore, **iter_model** provides **SyncIter** class for [Iterable],\nand **AsyncIter** for [AsyncIterable].\n\n---\n\n## Example\n\n```python\nfrom iter_model import SyncIter\n\nit = SyncIter(range(10))  # SyncIter for sync iterables\nresult = (\n    it.where(lambda x: x % 2 == 0)  # filter only odd values\n    .take(3)  # take first 3 value\n    .map(lambda x: x ** 2)  # square all values\n)\nprint(result.to_list())\n```\n\n## Links\n\n**Source code**: [github.com/VolodymyrBor/iter_model](https://github.com/VolodymyrBor/iter_model)\n\n**Documentation**: [iter_model](https://volodymyrbor.github.io/iter_model/)\n\n**Changelog**: [changelog](https://volodymyrbor.github.io/iter_model/changelog)\n\n[Iterable]: https://docs.python.org/3/library/typing.html#typing.Iterable\n[AsyncIterable]: https://docs.python.org/3/library/typing.html#typing.AsyncIterable\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "iter-model uses a method approach instead of individual functions to work with iterable objects.",
    "version": "3.0.0",
    "project_urls": {
        "Documentation": "https://volodymyrbor.github.io/iter_model/",
        "Homepage": "https://volodymyrbor.github.io/iter_model/",
        "Repository": "https://github.com/VolodymyrBor/iter_model"
    },
    "split_keywords": [
        "iterator",
        " iterable",
        " async"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93e8cb90dfc5c72d70f5b832a0c172cd10550469cfccaf802735603420e1c5ad",
                "md5": "176182665a435974cd233e15b87e47ae",
                "sha256": "d0daff5eb452ab5846eb4d0e30d6a4b7e5a6323143e5105244488b7b00cca65a"
            },
            "downloads": -1,
            "filename": "iter_model-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "176182665a435974cd233e15b87e47ae",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 13713,
            "upload_time": "2024-06-27T19:56:07",
            "upload_time_iso_8601": "2024-06-27T19:56:07.237749Z",
            "url": "https://files.pythonhosted.org/packages/93/e8/cb90dfc5c72d70f5b832a0c172cd10550469cfccaf802735603420e1c5ad/iter_model-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc3ba25246a796bff54c2f50d7c110c08c26ee4d3bfd6cef1000dc57652e7694",
                "md5": "b41dede5568a457a0b71ffb5553ec484",
                "sha256": "5b56fe833aa76378436eeb7c711c86c8d1f7ea6e24cad380e95f35bb46699df2"
            },
            "downloads": -1,
            "filename": "iter_model-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b41dede5568a457a0b71ffb5553ec484",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 10602,
            "upload_time": "2024-06-27T19:56:08",
            "upload_time_iso_8601": "2024-06-27T19:56:08.873092Z",
            "url": "https://files.pythonhosted.org/packages/bc/3b/a25246a796bff54c2f50d7c110c08c26ee4d3bfd6cef1000dc57652e7694/iter_model-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-27 19:56:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "VolodymyrBor",
    "github_project": "iter_model",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "iter_model"
}
        
Elapsed time: 3.56718s