iteroo


Nameiteroo JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryObject orientated iterator wrapper.
upload_time2025-07-25 22:46:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords functional iterators
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # iteroo

Object-oriented iterator wrapper for Python


## Description

**iteroo** provides a functional, object-oriented interface for working with iterators in Python. It wraps any iterable and exposes a rich set of methods for chaining, transformation, and collection, inspired by functional programming and modern iterator libraries.

- Chainable, lazy iterator operations
- Functional-style methods: `map`, `filter`, `takewhile`, `dropwhile`, `flatten`, etc.
- Collect results as lists, sum, count, and more
- 100% test coverage, MIT licensed

## Features

- `it`: Main iterator wrapper class
- `map`, `filter`, `enumerate`, `takewhile`, `dropwhile`, `flatten`, `pairwise`, `select`, `zip`, `cycle`, `diff`, `inmap`, `alltrue`, `allfalse`, `equal`, `allequal`, `sum`, `count`, `max`, `take_n`, `take_every_nth`
- Utility functions: `range`, `count`, `repeat`

## Installation

```bash
pip install iteroo
```
Or for development:
```bash
uv pip install -e '.[test]'
```

## Usage

```python
from iteroo import it

# Basic usage
nums = it([1, 2, 3, 4, 5])
even = nums.filter(lambda x: x % 2 == 0).collect()  # [2, 4]

# Chaining
result = (
    it.range(10)
      .filter(lambda x: x % 2)
      .map(lambda x: x * 10)
      .take_n(3)
      .collect()
)
# result: [10, 30, 50]

# Flattening
nested = it([[1, 2], [3, 4]])
flat = nested.flatten().collect()  # [1, 2, 3, 4]

# Pairwise difference
seq = it([1, 4, 9, 16])
diffs = seq.diff().collect()  # [3, 5, 7]

# Inmap (apply multiple functions to each element)
a = it([[1, 1], [2, 2], [3, 3]])
b = a.inmap([lambda x: x + 1, lambda x: x + 2]).collect()  # [[2, 3], [3, 4], [4, 5]]

# Utilities
from iteroo.it import repeat
assert repeat('a', 3).collect() == ['a', 'a', 'a']

```

## Testing

To run the tests and check coverage:

```bash
uv pip install -e '.[test]'
pytest --cov=src/iteroo --cov-report=term-missing
```

To generate an HTML coverage report:

```bash
pytest --cov=src/iteroo --cov-report=html
# Open htmlcov/index.html in your browser
```

## License

MIT License. See [LICENSE](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "iteroo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Chris Burbridge <cburbridge@gmail.com>",
    "keywords": "functional, iterators",
    "author": null,
    "author_email": "Chris Burbridge <cburbridge@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/83/c4/56e4a04030fff809ed6a65cad7c8f4c51228095033a42a2f5d15dd905662/iteroo-0.0.1.tar.gz",
    "platform": null,
    "description": "# iteroo\n\nObject-oriented iterator wrapper for Python\n\n\n## Description\n\n**iteroo** provides a functional, object-oriented interface for working with iterators in Python. It wraps any iterable and exposes a rich set of methods for chaining, transformation, and collection, inspired by functional programming and modern iterator libraries.\n\n- Chainable, lazy iterator operations\n- Functional-style methods: `map`, `filter`, `takewhile`, `dropwhile`, `flatten`, etc.\n- Collect results as lists, sum, count, and more\n- 100% test coverage, MIT licensed\n\n## Features\n\n- `it`: Main iterator wrapper class\n- `map`, `filter`, `enumerate`, `takewhile`, `dropwhile`, `flatten`, `pairwise`, `select`, `zip`, `cycle`, `diff`, `inmap`, `alltrue`, `allfalse`, `equal`, `allequal`, `sum`, `count`, `max`, `take_n`, `take_every_nth`\n- Utility functions: `range`, `count`, `repeat`\n\n## Installation\n\n```bash\npip install iteroo\n```\nOr for development:\n```bash\nuv pip install -e '.[test]'\n```\n\n## Usage\n\n```python\nfrom iteroo import it\n\n# Basic usage\nnums = it([1, 2, 3, 4, 5])\neven = nums.filter(lambda x: x % 2 == 0).collect()  # [2, 4]\n\n# Chaining\nresult = (\n    it.range(10)\n      .filter(lambda x: x % 2)\n      .map(lambda x: x * 10)\n      .take_n(3)\n      .collect()\n)\n# result: [10, 30, 50]\n\n# Flattening\nnested = it([[1, 2], [3, 4]])\nflat = nested.flatten().collect()  # [1, 2, 3, 4]\n\n# Pairwise difference\nseq = it([1, 4, 9, 16])\ndiffs = seq.diff().collect()  # [3, 5, 7]\n\n# Inmap (apply multiple functions to each element)\na = it([[1, 1], [2, 2], [3, 3]])\nb = a.inmap([lambda x: x + 1, lambda x: x + 2]).collect()  # [[2, 3], [3, 4], [4, 5]]\n\n# Utilities\nfrom iteroo.it import repeat\nassert repeat('a', 3).collect() == ['a', 'a', 'a']\n\n```\n\n## Testing\n\nTo run the tests and check coverage:\n\n```bash\nuv pip install -e '.[test]'\npytest --cov=src/iteroo --cov-report=term-missing\n```\n\nTo generate an HTML coverage report:\n\n```bash\npytest --cov=src/iteroo --cov-report=html\n# Open htmlcov/index.html in your browser\n```\n\n## License\n\nMIT License. See [LICENSE](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Object orientated iterator wrapper.",
    "version": "0.0.1",
    "project_urls": {
        "Bug Reports": "https://github.com/cburbridge/iteroo/issues",
        "Homepage": "https://github.com/cburbridge/iteroo",
        "Source": "https://github.com/cburbridge/iteroo"
    },
    "split_keywords": [
        "functional",
        " iterators"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6d0ed520ce117e51d9b49cfeadbabecb5a46b82bdaa017072299c5c1a05ae71b",
                "md5": "4c4036682c2d8ee8b26c8cfe34af992f",
                "sha256": "c7031747041f2983b6304f7642fd12080162804defca8a2abaeb4948f1630841"
            },
            "downloads": -1,
            "filename": "iteroo-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4c4036682c2d8ee8b26c8cfe34af992f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4084,
            "upload_time": "2025-07-25T22:46:35",
            "upload_time_iso_8601": "2025-07-25T22:46:35.229816Z",
            "url": "https://files.pythonhosted.org/packages/6d/0e/d520ce117e51d9b49cfeadbabecb5a46b82bdaa017072299c5c1a05ae71b/iteroo-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "83c456e4a04030fff809ed6a65cad7c8f4c51228095033a42a2f5d15dd905662",
                "md5": "bd867a0ac6860a2bb3cf5eea4129087d",
                "sha256": "b31226596eebc2face0d316085a9b6fb9d969641733240d99a16e34f9c2b7004"
            },
            "downloads": -1,
            "filename": "iteroo-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bd867a0ac6860a2bb3cf5eea4129087d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 27807,
            "upload_time": "2025-07-25T22:46:36",
            "upload_time_iso_8601": "2025-07-25T22:46:36.326714Z",
            "url": "https://files.pythonhosted.org/packages/83/c4/56e4a04030fff809ed6a65cad7c8f4c51228095033a42a2f5d15dd905662/iteroo-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 22:46:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cburbridge",
    "github_project": "iteroo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "iteroo"
}
        
Elapsed time: 1.19899s