iterators
Iterator utility classes and functions
Decision gist · record as of 2026-08-14
Yes, if you need simple timeout semantics on synchronous iterators and can tolerate dormant maintenance. The package has no dependencies, low install friction, and a permissive license. However, verify that the timeout mechanism meets your concurrency and performance requirements before relying on it in production—the project has not been actively maintained since early 2023.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later.
- Low install friction with no runtime dependencies.
- Package is dormant—last release was 2023-01-23 with no commits since 2024-07-31—so expect no active maintenance or bug fixes.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions.
last release 2023-01-23 (1299 days) · last repo commit 2024-07-31 · 10 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 721,807 downloads/mo, #5,229 on PyPI
Alternatives
Verify before relying
from iterators import TimeoutIterator
def iter_with_sleep():
yield 1
yield 2
i = iter_with_sleep()
it = TimeoutIterator(i, timeout=0.5)
print(next(it))
print(next(it))- Whether TimeoutIterator works correctly with generators that yield at unpredictable intervals or with very short timeout windows.
- Whether the timeout mechanism is thread-safe or suitable for concurrent iteration scenarios.
- Performance overhead of wrapping iterators, especially for high-frequency iteration patterns.
What it is and what it does
TimeoutIterator is a wrapper class that adds timeout semantics to any Python iterator. When you wrap an iterator with TimeoutIterator and call next() on it, the wrapper will wait for the underlying iterator to yield a value, but only up to a specified timeout duration. If the timeout expires before a value arrives, TimeoutIterator returns a sentinel object instead of blocking indefinitely or raising an exception.
The package supports both fixed timeouts (set once at construction) and dynamic timeout adjustment via set_timeout(). When a timeout occurs, iteration continues—the next call to next() will attempt to retrieve the next value from the underlying iterator with the current timeout setting. This is useful for scenarios where you're iterating over slow or potentially stalled sources and need to enforce a deadline without terminating the entire iteration.
Use it for
- Wrap a generator that fetches data from a slow source to enforce per-item timeout and skip items that take too long.
- Protect against runaway generators in a data pipeline by returning a sentinel when iteration stalls beyond a threshold.
- Dynamically adjust timeout thresholds during iteration based on observed latency or changing system conditions.
- Iterate over file handles or network streams with a deadline, gracefully handling slow or hung sources.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need simple timeout semantics on synchronous iterators and can tolerate dormant maintenance.
The package has no dependencies, low install friction, and a permissive license. However, verify that the timeout mechanism meets your concurrency and performance requirements before relying on it in production—the project has not been actively maintained since early 2023.
Install
iterators on PyPI
Before you install
Low install friction with no runtime dependencies. Package is dormant—last release was 2023-01-23 with no commits since 2024-07-31—so expect no active maintenance or bug fixes.
Requires Python 3.6 or later.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
from iterators import TimeoutIterator
def iter_with_sleep():
yield 1
yield 2
i = iter_with_sleep()
it = TimeoutIterator(i, timeout=0.5)
print(next(it))
print(next(it))
Verify before relying
- Whether TimeoutIterator works correctly with generators that yield at unpredictable intervals or with very short timeout windows.
- Whether the timeout mechanism is thread-safe or suitable for concurrent iteration scenarios.
- Performance overhead of wrapping iterators, especially for high-frequency iteration patterns.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,299 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 721,807 / month, #5,229 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules |
Evidence: iterators-0.2.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “iterator timeout wrapper”
- iteratorsWraps Python iterators to add timeout behavior, returning a sentinel…
- iterproxyWraps any iterable object to provide ORM-style query methods like…
- waiterWaiter provides iteration-based retry and polling with customizable…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also timeout-decorator · jaraco.itertools · waiter · scandir · pytest-timeouts · aioitertools · async-timeout · stopit · freezegun · sentinel