# thephpleague/csv

CSV data manipulation made easy in PHP

Repository: https://github.com/thephpleague/csv
Canonical: https://ross.abutalabs.com/products/csv
Homepage: https://csv.thephpleague.com
Language: PHP
License: MIT
License Family: permissive
Topics: php, csv-document, csv-converter, csv-filter, csv-query, csv
Last push: 2026-08-21T19:42:08+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 63, longevity 100
- inputs: {"age_days": 4657, "days_push": 12, "days_rel": 249, "gap_med": 20.5, "n_releases_24m": 15}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3480, forks 351 (observed 2026-08-28T04:08:06.833331+00:00)

## What it is
League CSV is a lightweight, framework-agnostic PHP library for reading, writing, filtering, and converting CSV documents. It offers a straightforward API with memory-efficient streaming, query features, object mapping, and conversion to JSON, XML, or HTML.

## Use cases
- parse csv files in php
- export database table to csv
- import csv records into a database
- convert csv to json or xml
- filter and query csv rows
- stream large csv files efficiently
- generate downloadable csv from php

## When to choose
- you work in PHP and need robust CSV parsing or writing beyond native fgetcsv
- you need memory-efficient handling of large CSV files
- you want to map CSV records to PHP objects or DTOs
- you need to convert CSV to JSON, XML, or HTML

## When to avoid
- you need a spreadsheet library with formula support like Excel files (use PhpSpreadsheet)
- your project is not in PHP
- you only need trivial one-line CSV parsing already covered by native PHP functions

## Facets
- artifact type: library
- maturity: active
- function: parser, serialization, data-science
- domain: files, developer-tools
- platform: php
- tags: csv, csv-reader, csv-writer, data-conversion, php-library, data-engineering

## Member repositories
- thephpleague/csv (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:06.833331+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:36:27.793201+00:00, confidence not recorded.
  - readme: https://github.com/thephpleague/csv (fetched 2026-08-28T04:08:06.833331+00:00, sha 19c229831c1d)
  - homepage: https://csv.thephpleague.com (fetched 2026-08-29T09:30:21.769489+00:00, sha c6aa2d236035)
  - site_page: https://csv.thephpleague.com/9.0 (fetched 2026-08-29T09:30:21.772403+00:00, sha 90691f7ad69b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
