PHPackages                             eloquent/fixie - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. eloquent/fixie

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

eloquent/fixie
==============

YAML-based data fixtures.

0.1.0(12y ago)91.2k1MITPHPPHP &gt;=5.3

Since Feb 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/eloquent/fixie)[ Packagist](https://packagist.org/packages/eloquent/fixie)[ Docs](https://github.com/eloquent/fixie)[ RSS](/packages/eloquent-fixie/feed)WikiDiscussions develop Synced 1mo ago

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

> # No longer maintained
>
> [](#no-longer-maintained)
>
> This package is no longer maintained. See [this statement](https://gist.github.com/ezzatron/713a548735febe3d76f8ca831bc895c0) for more info.

Fixie
=====

[](#fixie)

*YAML-based data fixtures.*

[![The most recent stable version is 0.1.0](https://camo.githubusercontent.com/51b67a5bf44c1931ae77d201236cde56e79d7fd24566da293e3c06af17aa1f34/687474703a2f2f696d672e736869656c64732e696f2f3a73656d7665722d302e312e302d79656c6c6f772e737667 "This project uses semantic versioning")](http://semver.org/)[![Current build status image](https://camo.githubusercontent.com/225c2830330f2504e6d00392bf0dd0fa948e95eebe4af44cf4406aba74fbfd81/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f656c6f7175656e742f64756d706c696e672f646576656c6f702e737667 "Current build status for the develop branch")](https://travis-ci.org/eloquent/dumpling)[![Current coverage status image](https://camo.githubusercontent.com/8ee009a78815ab41e63be0387e3d21fc6b42c66c5e06ca7d10671f1461b208df/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f656c6f7175656e742f64756d706c696e672f646576656c6f702e737667 "Current test coverage for the develop branch")](https://coveralls.io/r/eloquent/dumpling)

Installation and documentation
------------------------------

[](#installation-and-documentation)

- Available as [Composer](http://getcomposer.org/) package [eloquent/dumpling](https://packagist.org/packages/eloquent/dumpling).
- [API documentation](http://lqnt.co/dumpling/artifacts/documentation/api/) available.

What is Fixie?
--------------

[](#what-is-fixie)

Fixie is a format for storing tabular data. It blends the strengths of [YAML](http://yaml.org/)and [CSV](http://en.wikipedia.org/wiki/Comma-separated_values) to produce a syntax that is well suited for both human and machine readers.

The Fixie syntax is actually a subset of [YAML 1.2](http://www.yaml.org/spec/1.2/spec.html), meaning that any given example of Fixie syntax is also perfectly valid YAML. Unlike free-form YAML however, all Fixie variants can be read row-by-row, which allows for minimal memory usage when reading large amounts of data.

Output styles
-------------

[](#output-styles)

### Compact style

[](#compact-style)

The default style, recommended for data sets of any size.

```
columns:
 [name,      symbol, number, weight,     metallic, group                 ]
data: [
 [Hydrogen,  H,      1,      1.00794,    false,    null                  ],
 [Helium,    He,     2,      4.002602,   false,    'Noble gas'           ],
 [Lithium,   Li,     3,      6.941,      true,     'Alkali metal'        ],
 [Beryllium, Be,     4,      9.012182,   true,     'Alkaline earth metal'],
 [Boron,     B,      5,      10.811,     true,     null                  ],
 [Carbon,    C,      6,      12.0107,    false,    null                  ],
 [Nitrogen,  N,      7,      14.0067,    false,    Pnictogen             ],
 [Oxygen,    O,      8,      15.9994,    false,    Chalcogen             ],
 [Fluorine,  F,      9,      18.9984032, false,    Halogen               ],
 [Neon,      Ne,     10,     20.1797,    false,    'Noble gas'           ],
]
```

### Expanded style

[](#expanded-style)

This style is useful for small data sets where a more vertical layout improves human readability.

```
- name:     Hydrogen
  symbol:   H
  number:   1
  weight:   1.00794
  metallic: false
  group:    null

- name:     Helium
  symbol:   He
  number:   2
  weight:   4.002602
  metallic: false
  group:    'Noble gas'

- name:     Lithium
  symbol:   Li
  number:   3
  weight:   6.941
  metallic: true
  group:    'Alkali metal'

- name:     Beryllium
  symbol:   Be
  number:   4
  weight:   9.012182
  metallic: true
  group:    'Alkaline earth metal'

- name:     Boron
  symbol:   B
  number:   5
  weight:   10.811
  metallic: true
  group:    null

- name:     Carbon
  symbol:   C
  number:   6
  weight:   12.0107
  metallic: false
  group:    null

- name:     Nitrogen
  symbol:   N
  number:   7
  weight:   14.0067
  metallic: false
  group:    Pnictogen

- name:     Oxygen
  symbol:   O
  number:   8
  weight:   15.9994
  metallic: false
  group:    Chalcogen

- name:     Fluorine
  symbol:   F
  number:   9
  weight:   18.9984032
  metallic: false
  group:    Halogen

- name:     Neon
  symbol:   Ne
  number:   10
  weight:   20.1797
  metallic: false
  group:    'Noble gas'
```

### Output style variants

[](#output-style-variants)

Fixie implements multiple output styles. In addition to the 'aligned' [output styles](#output-styles) above, there are non-aligned variants of both compact and expanded styles that reduce file size at the cost of reduced human readability.

The `FixtureWriter` class takes, as its first constructor parameter, a class name to use when opening a file or stream for writing. The options available are (in the `Eloquent\Fixie\Writer` namespace):

#### SwitchingCompactFixtureWriteHandle

[](#switchingcompactfixturewritehandle)

This variant will buffer up to an approximate given data size (defaults to 10MiB). If the data written is within the size limit, the output will be that produced by the [AlignedCompactFixtureWriteHandle](#alignedcompactfixturewritehandle). If the size limit is exceeded, this variant will switch to unbuffered output using the [CompactFixtureWriteHandle](#compactfixturewritehandle).

This is the default variant used by Fixie, as it offers the best compromise between memory usage and human readability.

#### AlignedCompactFixtureWriteHandle

[](#alignedcompactfixturewritehandle)

Writes rows in the 'compact' style, and keeps column headers and row values aligned with each other. This style is excellent for human readability but poor for large data sets as the data must be buffered in memory. Unless the maximum data size is known in advance, it is recommended to use the [SwitchingCompactFixtureWriteHandle](#switchingcompactfixturewritehandle)instead.

#### CompactFixtureWriteHandle

[](#compactfixturewritehandle)

Writes rows in the 'compact' style, using the minimal amount of whitespace. This variant is excellent for any data size, but is not as good for human readability as other options. If human readability is not an issue, use this variant.

#### AlignedExpandedFixtureWriteHandle

[](#alignedexpandedfixturewritehandle)

Writes rows in the 'expanded' style, and aligns row values. A versatile variant that produces a much more vertically elongated output. Good for both human readability and memory usage.

#### ExpandedFixtureWriteHandle

[](#expandedfixturewritehandle)

Writes rows in the 'expanded' style, but does not align row values. Only useful if the data should be output in a similar way to typical YAML renderers.

Usage
-----

[](#usage)

### A little setup

[](#a-little-setup)

```
use Eloquent\Fixie\Reader\FixtureReader;
use Eloquent\Fixie\Writer\FixtureWriter;

$writer = new FixtureWriter;
$reader = new FixtureReader;

// some tabular data
$data = array(
    array('foo' => 'bar',  'baz' => 'qux'),
    array('foo' => 'doom', 'baz' => 'splat'),
);
```

### Writing row-by-row

[](#writing-row-by-row)

```
$handle = $writer->openFile('/path/to/file');
foreach ($data as $row) {
    $handle->write($row);
}
$handle->close();
```

### Writing an entire set of data

[](#writing-an-entire-set-of-data)

```
$handle = $writer->openFile('/path/to/file');
$handle->writeAll($data);
$handle->close();
```

### Reading row-by-row

[](#reading-row-by-row)

```
$handle = $reader->openFile('/path/to/file');
$data = array();
foreach ($handle as $row) {
    $data[] = $row;
}
$handle->close();
```

### Reading an entire set of data

[](#reading-an-entire-set-of-data)

```
$handle = $reader->openFile('/path/to/file');
$data = $handle->readAll();
$handle->close();
```

### Reading rows manually

[](#reading-rows-manually)

```
$handle = $reader->openFile('/path/to/file');
$row = $handle->read();
if (null !== $row){
    // some custom logic
}
$handle->close();
```

### Opening streams

[](#opening-streams)

```
$stream = fopen('php://temp', 'wb');
$handle = $writer->openStream($stream);
```

```
$stream = fopen('data://text/plain;base64,LSBmb28NCi0gYmFy', 'rb');
$handle = $reader->openStream($stream);
```

Comparison to CSV and YAML
--------------------------

[](#comparison-to-csv-and-yaml)

### CSV

[](#csv)

- Excellent for machine reading. Row-by-row reading means low memory use.
- No support for types. Every value is a string.
- Human readability is poor, especially with row values of differing lengths.
- String encoding support is unpredictable across implementations. This makes it a poor choice for multilingual data.

### YAML

[](#yaml)

- Type support. Strings, integers, floating-point values, booleans and nulls are all supported.
- Very human-readable when formatted correctly.
- Good string encoding support.
- Entire file must be read and parsed in one go. Memory usage scales with data size.

### Fixie

[](#fixie-1)

- Excellent for machine reading. Row-by-row reading means low memory use.
- Type support. Strings, integers, floating-point values, booleans and nulls are all supported.
- Very human-readable when formatted correctly.
- Good string encoding support.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

4478d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/100152?v=4)[Erin](/maintainers/ezzatron)[@ezzatron](https://github.com/ezzatron)

---

Top Contributors

[![ezzatron](https://avatars.githubusercontent.com/u/100152?v=4)](https://github.com/ezzatron "ezzatron (41 commits)")

---

Tags

Fixturedatayamlcsvfile

### Embed Badge

![Health badge](/badges/eloquent-fixie/health.svg)

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

###  Alternatives

[soapbox/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

2501.1M12](/packages/soapbox-laravel-formatter)[michalsn/codeigniter-markdown-pages

Markdown pages for CodeIgniter 4 framework

133.3k](/packages/michalsn-codeigniter-markdown-pages)

PHPackages © 2026

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