PHPackages                             terremoth/php-dsv - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. terremoth/php-dsv

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

terremoth/php-dsv
=================

v1.0.3(1y ago)15MITPHPPHP ^8.0

Since Nov 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/terremoth/php-dsv)[ Packagist](https://packagist.org/packages/terremoth/php-dsv)[ RSS](/packages/terremoth-php-dsv/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

PHP DSV Reader &amp; Writer
===========================

[](#php-dsv-reader--writer)

[![Test Run Status](https://github.com/terremoth/php-dsv/actions/workflows/workflow.yml/badge.svg?branch=main)](https://github.com/terremoth/php-dsv/actions/workflows/workflow.yml)[![License](https://camo.githubusercontent.com/0dda2344f03c9dd4994a5c0701a368e5c6a7e22b449012c31332d97b4f4529f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74657272656d6f74682f7068702d6473762e7376673f6c6f676f3d676e7526636f6c6f723d343162623133)](https://github.com/terremoth/php-dsv/blob/main/LICENSE)[![Latest Stable Version](https://camo.githubusercontent.com/4071f9698bb85acf79c130477a0e2ce561ebe3791133f5fff2a1bfbb6d267a9a/68747470733a2f2f706f7365722e707567782e6f72672f74657272656d6f74682f7068702d6473762f762f737461626c65)](https://packagist.org/packages/terremoth/php-dsv)[![Total Downloads](https://camo.githubusercontent.com/e276e4cc3f9a3e17c28974be3361c26ff5f84803f39133fc8e9f90248d571c3a/68747470733a2f2f706f7365722e707567782e6f72672f74657272656d6f74682f7068702d6473762f646f776e6c6f616473)](https://packagist.org/packages/terremoth/php-dsv)
[![codecov](https://camo.githubusercontent.com/0145f405ccf0a29fa3fd3e006b780fff1656a6a2cb67566248e42766afabe4ce/68747470733a2f2f636f6465636f762e696f2f6769746875622f74657272656d6f74682f7068702d6473762f67726170682f62616467652e7376673f746f6b656e3d5a45443134464e523042)](https://codecov.io/github/terremoth/php-dsv)[![Test Coverage](https://camo.githubusercontent.com/fb8187711ec57a0facecb4b60ec45c3565c2c5502feef769ce3237bb404a2b1e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f32393238373433623665393264386537303132382f746573745f636f766572616765)](https://codeclimate.com/github/terremoth/php-dsv/test_coverage)[![Psalm type coverage](https://camo.githubusercontent.com/10e62b1f797119a3e3bf3ad8b37dc606039edff905c263cf287a9d0966a38d9d/68747470733a2f2f73686570686572642e6465762f6769746875622f74657272656d6f74682f7068702d6473762f636f7665726167652e737667)](https://shepherd.dev/github/terremoth/php-dsv)[![Psalm level](https://camo.githubusercontent.com/dcf8fa6c03bb88924f7f3e4dc9298143eaf31c6ab88c8187e288ceae43b85003/68747470733a2f2f73686570686572642e6465762f6769746875622f74657272656d6f74682f7068702d6473762f6c6576656c2e737667)](https://shepherd.dev/github/terremoth/php-dsv)[![Codacy Badge](https://camo.githubusercontent.com/13a981d9afbfd58b2e15d40affb730e444d8c7def74375082c171777e4b4e6c3/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3065646636636539393963353438663861623939343238383631316533643066)](https://app.codacy.com/gh/terremoth/php-dsv/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Maintainability](https://camo.githubusercontent.com/b7581316ca38559cd1b10b218232af8b0863c54cbde17729db843ec207deef3e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f32393238373433623665393264386537303132382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/terremoth/php-dsv/maintainability)

Inspired by: [Why you should use and prefer DSV format instead of CSV](https://matthodges.com/posts/2024-08-12-csv-bad-dsv-good/)

See [demos/demo.php](demos/demo.php) for examples.

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

[](#installation)

```
composer require terremoth/php-dsv
```

Usage
-----

[](#usage)

```
require_once 'vendor/autoload.php';

use DSV\Writer;
use DSV\Reader;

$data = [
    ['Name', 'Comment'],
    ['Alice', 'She said, "Hello" and waved.'],
    ['Bob', 'This is a multi-line comment\r\nspanning two lines.'],
    ['Charlie', 'More fun with\ntwo lines.'],
    ['Diana', 'How about some UTF-8: café, naïve, résumé. 📝'],
    ['Edward', 'アップル'],
];

$writer = new Writer('demos/data.dsv');
$writer->write($data); // will write the $data to file in DSV format

$reader = new Reader('demos/data.dsv');
print_r($reader->read()); // will read the demos/data.dsv file and put it in array format
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

4

Last Release

542d ago

### Community

Maintainers

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

---

Top Contributors

[![terremoth](https://avatars.githubusercontent.com/u/11032344?v=4)](https://github.com/terremoth "terremoth (19 commits)")

---

Tags

data-parserdata-parsingdsvdsv-parserdsv-readerdata extractiondsvdata-parsing

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/terremoth-php-dsv/health.svg)

```
[![Health](https://phpackages.com/badges/terremoth-php-dsv/health.svg)](https://phpackages.com/packages/terremoth-php-dsv)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

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