PHPackages                             paalg/csv - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. paalg/csv

ActiveLibrary[File &amp; Storage](/categories/file-storage)

paalg/csv
=========

A little library handling CSV files

v0.1.0(2y ago)04apache-2.0PHPPHP ^7

Since Sep 11Pushed 2y ago1 watchersCompare

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

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

Csv library
===========

[](#csv-library)

This library is for parsing an iterating through lines in a CSV file.

Versions
--------

[](#versions)

- v0.1 The first version published

Usage
-----

[](#usage)

```
// Load standard CSV file with headers and "," as field separator
$csv = new Csv('import.csv');
$data = $csv->getData();
print_r($data);
print_r($csv->getHeaders());
```

The output of above code can be like this:

```
Array
(
    [0] => Array
        (
            [Year] => 1997
            [Make] => Ford
            [Model] => E350
            [Description] => ac, abs, moon
            [Price] => 3000.00
        )

    [1] => Array
        (
            [Year] => 1999
            [Make] => Chevy
            [Model] => Venture "Extended Edition"
            [Description] =>
            [Price] => 4900.00
        )
)
Array
(
    [0] => Year
    [1] => Make
    [2] => Model
    [3] => Description
    [4] => Price
)

```

If you need to iterate the CSV file, you can do this:

```
$csv = new Csv('data.csv');
foreach ($csv as $row) {
    print_r($row);
    foreach ($row as $fieldName => $value) {
        // do things with the fields in current row
    }
}
```

One iteration of above script will output something like this:

```
Array
(
    [Year] => 1999
    [Make] => Chevy
    [Model] => Venture "Extended Edition"
    [Description] =>
    [Price] => 4900.00
)

```

Unit testing
------------

[](#unit-testing)

The library has been thoroughly tested with unit tests (phpunit). You can run the tests with command `composer test`.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

980d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8632213def3cbbd7334bb32ccdf1fd7d9c529ed7dd321d386c8dae074382944?d=identicon)[paalg](/maintainers/paalg)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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