PHPackages                             sw897/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. sw897/csv

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

sw897/csv
=========

Csv data manipulation made easy in PHP

1.2(8y ago)017MITPHPPHP &gt;=7.0.10

Since Nov 29Pushed 8y agoCompare

[ Source](https://github.com/sw897/csv)[ Packagist](https://packagist.org/packages/sw897/csv)[ Docs](http://csv.thephpleague.com)[ RSS](/packages/sw897-csv/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

CSV
===

[](#csv)

[![Latest Version](https://camo.githubusercontent.com/cdd45b8f7b58a15ccdff03e934a13b39f515c8082ff6ce444d1b8cb0cf1f6dc6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7468657068706c65616775652f6373762e7376673f7374796c653d666c61742d737175617265)](https://github.com/thephpleague/csv/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c1442f7a9a2450ac2553e91cf761115662b2a81151a47eac8d124677627b7279/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f6373762f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/thephpleague/csv)[![Coverage Status](https://camo.githubusercontent.com/8092fde7922ed5f1d093f520cc08ab66abd9166335f3ac0f4b5774f7b175dac4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7468657068706c65616775652f6373762e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/csv/code-structure)[![Quality Score](https://camo.githubusercontent.com/6f9d8034657350241fa64f621a25731958bca34fafed81c523ad3c83e5dc283d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f6373762e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/csv)[![Total Downloads](https://camo.githubusercontent.com/adfdb4bc1efb69e07b322dadbbe0430365ae5c31d4dc52e49b0fd60a108fdfb2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f6373762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/csv)

Csv is a simple library to ease CSV parsing, writing and filtering in PHP. The goal of the library is to be powerful while remaining lightweight, by utilizing PHP native classes whenever possible.

Highlights
----------

[](#highlights)

- Simple API
- Read and Write to CSV documents in a memory efficient and scalable way
- Use SPL to interact with the CSV documents
- Support PHP Stream filtering capabilities
- Transform CSV documents into popular format (JSON, XML or HTML)
- Fully documented
- Fully unit tested
- Framework-agnostic
- Composer ready, [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/) compliant

Documentation
-------------

[](#documentation)

Full documentation can be found at [csv.thephpleague.com](http://csv.thephpleague.com).

System Requirements
-------------------

[](#system-requirements)

You need **PHP &gt;= 7.0.10** and the `mbstring` extension to use `Csv` but the latest stable version of PHP is recommended.

Install
-------

[](#install)

Install `Csv` using Composer.

```
$ composer require league/csv

```

Configuration
-------------

[](#configuration)

**Warning:** If your CSV document was created or is read on a Macintosh computer, add the following lines before using the library to help [PHP detect line ending](http://php.net/manual/en/function.fgetcsv.php#refsect1-function.fgetcsv-returnvalues).

```
if (!ini_get("auto_detect_line_endings")) {
    ini_set("auto_detect_line_endings", '1');
}
```

Testing
-------

[](#testing)

`Csv` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/). To run the tests, run the following command from the project folder.

```
$ composer test
```

Contributing
------------

[](#contributing)

Contributions are welcome and will be fully credited. Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [ignace nyamagana butera](https://github.com/nyamsprod)
- [All Contributors](https://github.com/thephpleague/csv/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

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

Total

3

Last Release

3070d ago

### Community

Maintainers

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

---

Top Contributors

[![nyamsprod](https://avatars.githubusercontent.com/u/51073?v=4)](https://github.com/nyamsprod "nyamsprod (682 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (5 commits)")[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (3 commits)")[![btmash](https://avatars.githubusercontent.com/u/109608?v=4)](https://github.com/btmash "btmash (2 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (2 commits)")[![HeyRatFans](https://avatars.githubusercontent.com/u/1496909?v=4)](https://github.com/HeyRatFans "HeyRatFans (1 commits)")[![jblotus](https://avatars.githubusercontent.com/u/382230?v=4)](https://github.com/jblotus "jblotus (1 commits)")[![kronthto](https://avatars.githubusercontent.com/u/17156142?v=4)](https://github.com/kronthto "kronthto (1 commits)")[![leomarquine](https://avatars.githubusercontent.com/u/17835448?v=4)](https://github.com/leomarquine "leomarquine (1 commits)")[![mfrost503](https://avatars.githubusercontent.com/u/660067?v=4)](https://github.com/mfrost503 "mfrost503 (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (1 commits)")[![Samyoul](https://avatars.githubusercontent.com/u/5702426?v=4)](https://github.com/Samyoul "Samyoul (1 commits)")[![shameerc](https://avatars.githubusercontent.com/u/275500?v=4)](https://github.com/shameerc "shameerc (1 commits)")[![AC-TimRourke](https://avatars.githubusercontent.com/u/15127748?v=4)](https://github.com/AC-TimRourke "AC-TimRourke (1 commits)")[![vlakarados](https://avatars.githubusercontent.com/u/386678?v=4)](https://github.com/vlakarados "vlakarados (1 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (1 commits)")[![bkonetzny](https://avatars.githubusercontent.com/u/5451122?v=4)](https://github.com/bkonetzny "bkonetzny (1 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (1 commits)")[![Heart1010](https://avatars.githubusercontent.com/u/1481680?v=4)](https://github.com/Heart1010 "Heart1010 (1 commits)")

---

Tags

exportcsvfilterimportreadwrite

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[league/csv

CSV data manipulation made easy in PHP

3.5k166.1M641](/packages/league-csv)[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M710](/packages/maatwebsite-excel)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M128](/packages/openspout-openspout)[goodby/csv

CSV import/export library

9555.6M23](/packages/goodby-csv)[shuchkin/simplecsv

Parse and retrieve data from CSV files. Export data to CSV.

5192.4k](/packages/shuchkin-simplecsv)[handcraftedinthealps/goodby-csv

CSV import/export library

441.6M4](/packages/handcraftedinthealps-goodby-csv)

PHPackages © 2026

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