PHPackages                             yogarine/csv-utils - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. yogarine/csv-utils

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

yogarine/csv-utils
==================

CSV utils by Yogarine

v1.0.1(2y ago)0101.7k—6.7%BSD-2-ClausePHPPHP &gt;=5.3.0

Since Feb 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AlwinGarside/csv-utils)[ Packagist](https://packagist.org/packages/yogarine/csv-utils)[ Docs](https://github.com/Yogarine/csv-utils)[ RSS](/packages/yogarine-csv-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

CSV Utils
=========

[](#csv-utils)

This library currently contains the CsvFile class, which makes it easy to iterate through CSV files of any size and makeup.

Installation
------------

[](#installation)

```
composer require "yogarine/csv-utils:^1.0"
```

CsvFile
-------

[](#csvfile)

The CsvFile class makes it easy to iterate through CSV files of any size. It implements `Iterator` and `SeekableIterator` so you can easily loop through the CSV using `foreach`:

### Usage

[](#usage)

Let's say you have a file called `foo.csv` with the following content:

```
id,name,description
0,foo,"This is a Foo"
1,bar,"This is a Bar"
2,baz,"This is a Baz"
3,qux,"This is a Qux"

```

You can iterate through it like this:

```
$csvFile = new CsvFile('foo.csv');

foreach ($csvFile as $row) {
	$id          = $row['id'];
	$name        = $row['name'];
	$description = $row['description'];
}
```

#### No header row

[](#no-header-row)

If your CSV doesn't have a header row:

```
0,foo,"This is a Foo"
1,bar,"This is a Bar"
2,baz,"This is a Baz"
3,qux,"This is a Qux"

```

Use the `$headerRow` argument to omit it:

```
$csvFile = new CsvFile('foo.csv', CsvFile::HEADER_ROW_NONE);

foreach ($csvFile as $row) {
	list($id, $name, $description) = $row;
}
```

#### Other formats

[](#other-formats)

Other formats, like PSV or TSV are also supported:

```
id|name|description
0|foo|"This is a Foo"
1|bar|"This is a Bar"
2|baz|"This is a Baz"
3|qux|"This is a Qux"

```

```
$csvFile = new CsvFile('foo.csv', 0, '|');
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~424 days

Total

5

Last Release

964d ago

Major Versions

0.1.x-dev → v1.0.02019-08-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/17518a08933290f58c1665feec25cf0939d1c6413b7b4cc25ef6d965b9fcc473?d=identicon)[Alwin Garside](/maintainers/Alwin%20Garside)

---

Top Contributors

[![AlwinGarside](https://avatars.githubusercontent.com/u/193043?v=4)](https://github.com/AlwinGarside "AlwinGarside (7 commits)")

---

Tags

csvutil

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yogarine-csv-utils/health.svg)

```
[![Health](https://phpackages.com/badges/yogarine-csv-utils/health.svg)](https://phpackages.com/packages/yogarine-csv-utils)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[league/csv

CSV data manipulation made easy in PHP

3.5k166.1M646](/packages/league-csv)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k57.6M131](/packages/openspout-openspout)[goodby/csv

CSV import/export library

9555.6M23](/packages/goodby-csv)[sonata-project/exporter

Lightweight Exporter library

44920.9M35](/packages/sonata-project-exporter)

PHPackages © 2026

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