PHPackages                             kjljon/streamingiterable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. kjljon/streamingiterable

ActiveLibrary[HTTP &amp; Networking](/categories/http)

kjljon/streamingiterable
========================

Convert iteratables into with streams using psr-7 without any other dependencies

v1.0.0(3y ago)04MITPHPPHP ^8.0

Since Jul 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/KJLJon/StreamingIterable)[ Packagist](https://packagist.org/packages/kjljon/streamingiterable)[ RSS](/packages/kjljon-streamingiterable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

StreamingIterable
=================

[](#streamingiterable)

The idea of this package is to make it easier to work with iterable data as streams

Problem it solves
-----------------

[](#problem-it-solves)

I find myself exporting data to the file system and using flysystem's writeStream. This becomes an issue when you don't have much local storage to write large exports to.

So my first iteration was pretty ugly (but worked), but then I saw what Guzzle's PSR-7 package did with [StreamWrapper](https://github.com/guzzle/psr7/blob/13388f00956b1503577598873fffb5ae994b5737/src/StreamWrapper.php)and using PSR-7 and figured I could refactor my app to use PSR-7.

My second iteration worked, but still assumed the export was a specific file type (csv).
When I had the requirements to stream JSON, I decided to refactor a little again by adding the ability to add a formatter decorator.

Usage
-----

[](#usage)

```
$iterable = [
    ['first' => 'Jim', 'last' => 'Thompson', 'month' => 'April'],
    ['first' => 'Tim', 'last' => 'Johnson', 'month' => 'December']
];

$formatter = new KJLJon\StreamingIterable\Formatter\CsvFormatter();
$stream = new KJLJon\StreamingIterable\IterableToReaderStream($iterable, $formatter);
$fp = KJLJon\StreamingIterable\StreamWrapper::getResource($stream);

//do something with stream (IE: flyweight's writeStream($location, $fp);
fpassthru($fp);

fclose($fp);
```

Questions / Comments
--------------------

[](#questions--comments)

Please open an issue and/or pull request

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1397d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/529ff41b7a5f6fd157d3d2e64350dd7acf0c484addd0f94ed3ec91a6fbe2f635?d=identicon)[KJLJon](/maintainers/KJLJon)

---

Tags

psr-7jsonarraypsr7generatorcsviteratorStreamsiterable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kjljon-streamingiterable/health.svg)

```
[![Health](https://phpackages.com/badges/kjljon-streamingiterable/health.svg)](https://phpackages.com/packages/kjljon-streamingiterable)
```

###  Alternatives

[league/route

Fast routing and dispatch component including PSR-15 middleware, built on top of FastRoute.

6633.1M115](/packages/league-route)[dflydev/fig-cookies

Cookies for PSR-7 HTTP Message Interface.

2268.5M102](/packages/dflydev-fig-cookies)[violet/streaming-json-encoder

Library for iteratively encoding large JSON documents piece by piece

3162.1M5](/packages/violet-streaming-json-encoder)[neomerx/cors-psr7

Framework agnostic (PSR-7) CORS implementation (www.w3.org/TR/cors/)

682.4M19](/packages/neomerx-cors-psr7)[jimtools/jwt-auth

PSR-15 JWT Authentication middleware, A replacement for tuupola/slim-jwt-auth

20142.3k3](/packages/jimtools-jwt-auth)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
