PHPackages                             almaudoh/csvtools - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. almaudoh/csvtools

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

almaudoh/csvtools
=================

Tools for importing, parsing and structuring CSV files and data

0.9.x-dev(8y ago)14421GPL-3.0PHPPHP ^5.5.9 || ^7.0

Since Sep 15Pushed 2y agoCompare

[ Source](https://github.com/almaudoh/csvtools)[ Packagist](https://packagist.org/packages/almaudoh/csvtools)[ RSS](/packages/almaudoh-csvtools/feed)WikiDiscussions master Synced 4w ago

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

CSV Tools
---------

[](#csv-tools)

Simple PHP based classes for importing, parsing and structuring CSV files and data.

It is made up of just two files, which contain a parser and then a mapper. The parser class parses the CSV files, which the mapper class allows mapping of the CSV file headers to another set of keys. The mapper class provides allows iteration over the CSV data and array access to each of the columns. The mapper implements `\Iterator`, `\ArrayAccess` and `\Countable`.

Example usages:

#### filename.csv

[](#filenamecsv)

```
NAME,MOBILE,MOBILE2,EMAIL,CITY,COUNTRY,BIRTH_DAY,WORK,NOTES,ACTIVE_ROLES,WANTED_ROLES
Jolly,2348030783839,,noreply@example.com,NoCity,NoCountry,38758,My work,My Notes,,
Nolly,2348038983839,2348030783839,noreply@example.com,NoCity,NoCountry,38758,My work,My Notes,,
,,,,,,,,,,
Polly,2348030783839,2348030783839,noreply@example.com,NoCity,NoCountry,38758,My work,My Notes,,
Solly,2348030783457,2348030783839,3reply@example.com,NoCity,NoCountry,38758,My work,My Notes,,
,,,,,,,,,,
,,,,,,,,,,
Lolly,2347090783839,,noreply@example.com,NoCity,NoCountry,38758,My work,My Notes,,
Wolly,2347090783234,,1reply@example.com,NoCity,NoCountry,38758,My work,My Notes,,
,,,,,,,,,,

```

```
$mapping = [
    'name' => 'NAME',
    'phone' => 'MOBILE',
    'phone2' => 'MOBILE2',
    'email' => 'EMAIL',
    'city' => 'CITY',
    'country' => 'COUNTRY',
    'dob' => 'BIRTH_DAY',
    'address' => 'WORK',
    'notes' => 'NOTES',
    'roles' => 'ACTIVE_ROLES',
    'additional_roles' => 'WANTED_ROLES',
];
$csv = (new CsvDataListMapper())
            ->setSourceFile('filename.csv')
            ->setDataMap($mapping);
foreach ($csv as $record) {
    write_to_database($record);
    print($record['name']);
}
```

prints

```
Jolly
Nolly

Polly
Solly

Lolly
Wolly

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

3210d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4356813?v=4)[almaudoh](/maintainers/almaudoh)[@almaudoh](https://github.com/almaudoh)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/almaudoh-csvtools/health.svg)

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

112.9k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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