devel/py-iterable-io - The NetBSD Packages Collection

Adapt generators and other iterables to a python file-like interface

`iterable-io` is a small Python library that provides an adapter so
that it's possible to read from
[iterable](https://docs.python.org/3/glossary.html#term-iterable)
objects in the same way as
[file-like](https://docs.python.org/3/glossary.html#term-file-object)
objects.

It is primarily useful as "glue" between two incompatible
interfaces. As an example, in the case where one interface expects a
file-like object to call `.read()` on, and the other only provides a
generator of bytes.

One way to solve this issue would be to write all the bytes in the
generator to a temporary file, then provide that file instead, but if
the generator produces a large amount of data then this is both slow
to start, and resource-intensive.

This library allows streaming data between these two incompatible
interfaces so as data is requested by `.read()`, it's pulled from the
iterable. This keeps resource usage low and removes the startup

Build dependencies

devel/py-setuptools devel/py-build misc/py-installer pkgtools/mktools pkgtools/cwrappers

Runtime dependencies

lang/python312 lang/python312

Binary packages

OSArchitectureVersion
(none)

Binary packages can be installed with the high-level tool pkgin (which can be installed with pkg_add) or pkg_add(1) (installed by default). The NetBSD packages collection is also designed to permit easy installation from source.

Available build options

(none)

Known vulnerabilities

The pkg_admin audit command locates any installed package which has been mentioned in security advisories as having vulnerabilities.

Please note the vulnerabilities database might not be fully accurate, and not every bug is exploitable with every configuration.


Problem reports, updates or suggestions for this package should be reported with send-pr.