PHPackages                             mdantas/csv-map - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mdantas/csv-map

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mdantas/csv-map
===============

This goal of lib, is a implementation methods top of spout, to group, filter, extract some informations from csv files.

v2.0(5y ago)010MITPHPPHP &gt;=7.2

Since Jul 21Pushed 5y agoCompare

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

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

#### CSV-Map

[](#csv-map)

This lib have goal to manage some csv files with a filter methods, it is built top of [box/soap](https://github.com/box/spout), for more detailed examples, see: [Tests Examples](https://github.com/lpj145/csv-map/tree/main/tests).

##### Requirements

[](#requirements)

```
-   >= PHP7.2
-   box/spout 3.1.0

```

##### Install

[](#install)

```
composer require mdantas/csv-map
```

##### Methods

[](#methods)

All methods can be found at `CsvMap\Interfaces\CsvCollectionInterface`

`getHeaders` - Get array of headers from csv file.

`hasHeader` - Check if header exists on csv file.

`groupBy` - group arrays of values, the index of array is based on `$row[headerName]`.

`combine` - mount array by value of index by row and intersect values from some headers.

`extract` - extract only columns of values, with or without duplicated values.

`isEmpty` - check if collection is empty.

`each` - shortcut for simple callable function on each item.

`toArray` - produces array indexed by header name with row values, like: `[$headername => $rowValue]`

##### Examples

[](#examples)

```
use CsvMap\Collection;

$fileCsvPath = './filecsv';

$csvCollection = Collection::factory($fileCsvPath);

$csvCollection->getHeaders(): array;

$csvCollection->hasHeader('headerName'): bool;

$csvCollection->combine('id', 'name', 'id', ...): array;

$csvCollection->groupBy('id'): array;

$csvCollection->extract('id', true): array // Last param remove duplicated registers

$csvCollection->isEmpty(): bool;

$csvCollection->each(function($item) => {
    print_r($item);
});

$csvCollection->toArray();
```

##### Tests

[](#tests)

```
composer run tests
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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 ~0 days

Total

3

Last Release

2127d ago

Major Versions

v1.1 → v2.02020-07-21

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11980109?v=4)[Marcos Dantas](/maintainers/lpj145)[@lpj145](https://github.com/lpj145)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[rafwell/laravel-simplegrid

A simple component for generating powerful grids with Laravel.

362.9k](/packages/rafwell-laravel-simplegrid)

PHPackages © 2026

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