PHPackages                             fbk/csvmapper - 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. fbk/csvmapper

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

fbk/csvmapper
=============

CSV parser with callbacks on fields

0.1.1(11y ago)1461[2 issues](https://github.com/danieleorler/CSVMapper/issues)MITPHPPHP &gt;=5.3.0

Since Aug 23Pushed 11y ago2 watchersCompare

[ Source](https://github.com/danieleorler/CSVMapper)[ Packagist](https://packagist.org/packages/fbk/csvmapper)[ Docs](https://github.com/danieleorler/CSVMapper)[ RSS](/packages/fbk-csvmapper/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (3)Versions (7)Used By (0)

CSVMapper
=========

[](#csvmapper)

Official repo stats

[![Build Status](https://camo.githubusercontent.com/28c7c5d45bee8b8a1c3880db877f9bccd58a6d2edfd8c6d20739c05379aee982/68747470733a2f2f7472617669732d63692e6f72672f64616e69656c656f726c65722f4353564d61707065722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/danieleorler/CSVMapper)[![Coverage Status](https://camo.githubusercontent.com/2ff0309d5f7c02acccaead4d3fbcee147d7635a8b4b96c8cc4adac09bcf154b4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f64616e69656c656f726c65722f4353564d61707065722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/danieleorler/CSVMapper?branch=master)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/bab78246987bd1dd53cbf701bec9b6ba566303a523a342be141078a9bb424b07/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64616e69656c656f726c65722f4353564d61707065722f6261646765732f7175616c6974792d73636f72652e706e673f733d65366631336562323665393936316230656466303261316665633165343931343361373937356361)](https://scrutinizer-ci.com/g/danieleorler/CSVMapper/)

CSVMapper is a PHP library which parses CSV files.

It allows to map the file to an array by defining some file configurations and each (wanted) columns properties.

File Settings
=============

[](#file-settings)

CSVMapper needs to now where the file is located and which is the columns separator.

It il also possible to specify how many columns are expected so that it aborts if the number of columns doesn't match.

```
    $setting = new SettingManager();
    $config->set_setting('folder','./tests');
    $config->set_setting('filename','myfile.csv');
    $config->set_setting('separator',';');
    $config->set_setting('columns_allowed',3);
```

Mappings
========

[](#mappings)

CSVMapper extracts only the columns which are defined with mappings. With a mapping it is possible to specify the position of the column, which function to apply to the value and how to test the value.

```
    $mapping = new MappingManager();
    // retrieve column number 1 (counting from 0) and label it as year
    $mapping->set_mapping("year", array('key'=>1,'fn'=>FALSE,'test'=>FALSE));
    // retrieve column number 2 (counting from 0) and label it as temperature, apply to each value the function 'return floatval($input);'
    $mapping->set_mapping("temperature", array('key'=>2, 'fn'=>create_function('$input','return floatval($input);'),'test'=>FALSE));
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61% 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 ~159 days

Total

4

Last Release

4215d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/254141?v=4)[Daniele Orler](/maintainers/danieleorler)[@danieleorler](https://github.com/danieleorler)

---

Top Contributors

[![danieleorler](https://avatars.githubusercontent.com/u/254141?v=4)](https://github.com/danieleorler "danieleorler (36 commits)")[![AndreaGot](https://avatars.githubusercontent.com/u/1503089?v=4)](https://github.com/AndreaGot "AndreaGot (23 commits)")

---

Tags

csv

### Embed Badge

![Health badge](/badges/fbk-csvmapper/health.svg)

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

###  Alternatives

[mledoze/countries

List of world countries in JSON, CSV, XML and YAML

6.2k733.8k6](/packages/mledoze-countries)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k45](/packages/friendsoftypo3-content-blocks)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[dracoblue/craur

A lossless xml to json and json to xml converter (and csv/xlsx/yaml). Writing PHP Json/Xml/Csv/Yaml/excel Importers made easy

4643.8k3](/packages/dracoblue-craur)[jbzoo/csv-blueprint

CLI Utility for Validating and Generating CSV files based on custom rules. It ensures your data meets specified criteria, streamlining data management and integrity checks.

573.2k](/packages/jbzoo-csv-blueprint)[phpnt/yii2-export

Yii2 It saves data in xls, csv, word, html, pdf files.

158.9k](/packages/phpnt-yii2-export)

PHPackages © 2026

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