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(4y ago)04MITPHPPHP ^8.0

Since Jul 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/KJLJon/StreamingIterable)[ Packagist](https://packagist.org/packages/kjljon/streamingiterable)[ RSS](/packages/kjljon-streamingiterable/feed)WikiDiscussions main Synced 1w 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 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

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

1492d 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

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.4k](/packages/guzzlehttp-psr7)[league/route

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

6693.3M159](/packages/league-route)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[mimmi20/browser-detector

Library to detect Browsers and Devices

49158.4k5](/packages/mimmi20-browser-detector)[sunrise/http-router

A powerful solution as the foundation of your project.

16852.3k12](/packages/sunrise-http-router)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

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

PHPackages © 2026

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