iter_model


Nameiter_model JSON
Version 2.3.2 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-04-12 11:37:13
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/65/dd/c895804547cfda8adaaabd39a0cc43953270d552a5edfdf0e3a153a4be76/iter_model-2.3.2.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": "2.3.2",
    "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": "a4c8397f9cdce44b524b1991d6c5314738e06b1f8b4f55e887c33fa6146e79c3",
                "md5": "bbdf19c0effd87cc13f2aa56a7bc068e",
                "sha256": "dde983a1b029267ee2e260ace7e103b2964c28164083ff51a044f92db60ee9e4"
            },
            "downloads": -1,
            "filename": "iter_model-2.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bbdf19c0effd87cc13f2aa56a7bc068e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 13845,
            "upload_time": "2024-04-12T11:37:10",
            "upload_time_iso_8601": "2024-04-12T11:37:10.031353Z",
            "url": "https://files.pythonhosted.org/packages/a4/c8/397f9cdce44b524b1991d6c5314738e06b1f8b4f55e887c33fa6146e79c3/iter_model-2.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65ddc895804547cfda8adaaabd39a0cc43953270d552a5edfdf0e3a153a4be76",
                "md5": "3bcc2c2019be9ae5284fcec419a4c250",
                "sha256": "47afbf96a87086b1e332e1d12e0194d8022e1c5c4f5c340a6d147b10cda80543"
            },
            "downloads": -1,
            "filename": "iter_model-2.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3bcc2c2019be9ae5284fcec419a4c250",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 11018,
            "upload_time": "2024-04-12T11:37:13",
            "upload_time_iso_8601": "2024-04-12T11:37:13.730190Z",
            "url": "https://files.pythonhosted.org/packages/65/dd/c895804547cfda8adaaabd39a0cc43953270d552a5edfdf0e3a153a4be76/iter_model-2.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-12 11:37:13",
    "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: 0.21809s