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

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

ajgl/csv
========

Simple library to read and write CSV files (includes a RFC 4180 compliant implementation)

0.5.1(5y ago)58.9k11MITPHPPHP ^7.3 || ^8.0

Since Nov 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ajgarlag/AjglCsv)[ Packagist](https://packagist.org/packages/ajgl/csv)[ Docs](https://github.com/ajgarlag/AjglCsv)[ RSS](/packages/ajgl-csv/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (10)Used By (1)

AjglCsv
=======

[](#ajglcsv)

The AjglCsv component allows you to read and write CSV files.

[![Build Status](https://github.com/ajgarlag/AjglCsv/workflows/test/badge.svg?branch=master)](https://github.com/ajgarlag/AjglCsv/actions)[![Latest Stable Version](https://camo.githubusercontent.com/f654358999e302fb74bb4210c28cc31696f1c8e689204fa6798962f0fb477259/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f6373762f762f737461626c652e706e67)](https://packagist.org/packages/ajgl/csv)[![Latest Unstable Version](https://camo.githubusercontent.com/06c1ea5d82ec963f91f7148ff3019cc36f97d8afa237cd9c09dbe946b1097679/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f6373762f762f756e737461626c652e706e67)](https://packagist.org/packages/ajgl/csv)[![Total Downloads](https://camo.githubusercontent.com/09a47b5d61df27ba83db4afeeea259949b5c5aa00feb9dc21afc6d25e160d89b/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f6373762f646f776e6c6f6164732e706e67)](https://packagist.org/packages/ajgl/csv)[![Montly Downloads](https://camo.githubusercontent.com/3b3edff3041885444d3eb494cde35b492915a74971ceeb4f8643b41807d53339/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f6373762f642f6d6f6e74686c792e706e67)](https://packagist.org/packages/ajgl/csv)[![Daily Downloads](https://camo.githubusercontent.com/fae5519eaf1736e12f8cd0749c900dc5decdabdcc00133994462820370144b75/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f6373762f642f6461696c792e706e67)](https://packagist.org/packages/ajgl/csv)[![License](https://camo.githubusercontent.com/4847f9a2504cfc8c9f63d012868998b585f7e32eb6ec2108f0b4c647d4e17955/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f6373762f6c6963656e73652e706e67)](https://packagist.org/packages/ajgl/csv)[![SensioLabsInsight](https://camo.githubusercontent.com/c9ba06d06da05780ae257c3d29823afe7d99a7fca69b745e828dc1b2abde120f/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34376138666265382d633966372d343864382d613065372d3462333930366438653438662f6d696e692e706e67)](https://insight.sensiolabs.com/projects/47a8fbe8-c9f7-48d8-a0e7-4b3906d8e48f)

There are currently two different implementations for the reader and writer classes:

- An implementation using the native [fgetcsv](http://www.php.net/manual/function.fgetcsv.php) and [fputcsv](http://www.php.net/manual/function.fputcsv.php) functions
- An implementation compatible with the [RFC 4180](https://tools.ietf.org/html/rfc4180)

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

[](#installation)

To install the latest stable version of this component, open a console and execute the following command:

```
$ composer require ajgl/csv

```

Usage
-----

[](#usage)

The simplest way to use this library is to create a Ajgl\\Csv\\Csv instance with:

```
$csv = Ajgl\Csv\Csv::create();
```

By default, the library uses the native f??tcsv functions. If you want to read or write [RFC 4180](https://tools.ietf.org/html/rfc4180) compatible files, you should set the default reader and writer types to `rfc` with:

```
$csv->setDefaultReaderType('rfc');
$csv->setDefaultWriterType('rfc');
```

To create a new CSV reader or writer, you should call:

```
$reader = $csv->createReader('/path/to/input.csv');
$writer = $csv->createWriter('/path/to/output.csv');
```

Symfony Bundle
--------------

[](#symfony-bundle)

If you need to integrate these library into your Symfony Framework app, you can install the [AjglCsvBundle](https://github.com/ajgarlag/AjglCsvBundle).

License
-------

[](#license)

This component is under the MIT license. See the complete license in the [LICENSE](LICENSE) file.

Reporting an issue or a feature request
---------------------------------------

[](#reporting-an-issue-or-a-feature-request)

Issues and feature requests are tracked in the [Github issue tracker](https://github.com/ajgarlag/AjglCsv/issues).

Author Information
------------------

[](#author-information)

Developed with ♥ by [Antonio J. García Lagar](http://aj.garcialagar.es).

If you find this component useful, please add a ★ in the [GitHub repository page](https://github.com/ajgarlag/AjglCsv) and/or the [Packagist package page](https://packagist.org/packages/ajgl/csv).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% 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 ~369 days

Recently: every ~581 days

Total

9

Last Release

1977d ago

PHP version history (3 changes)0.0.1PHP &gt;=5.3.2

0.4.0PHP &gt;=5.4.0

0.5.0PHP ^7.3 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![ajgarlag](https://avatars.githubusercontent.com/u/388184?v=4)](https://github.com/ajgarlag "ajgarlag (92 commits)")[![nubs](https://avatars.githubusercontent.com/u/57673?v=4)](https://github.com/nubs "nubs (1 commits)")

---

Tags

csv

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  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.1k57.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)
