PHPackages                             sigwin/xezilaires-dev - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. sigwin/xezilaires-dev

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

sigwin/xezilaires-dev
=====================

Iterate structured Excel spreadsheets, normalize rows into value objects, validate, serialize into CSV, JSON, XML

1.0.0(2y ago)611.3k4[27 issues](https://github.com/sigwinhq/xezilaires-dev/issues)[1 PRs](https://github.com/sigwinhq/xezilaires-dev/pulls)MITPHPPHP ^8.2

Since Aug 23Pushed 1y ago3 watchersCompare

[ Source](https://github.com/sigwinhq/xezilaires-dev)[ Packagist](https://packagist.org/packages/sigwin/xezilaires-dev)[ RSS](/packages/sigwin-xezilaires-dev/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (20)Used By (0)

Xezilaires
==========

[](#xezilaires)

Xezilaires is a PHP library which helps to iterate structured Excel spreadsheets, normalize rows into value objects, validate, serialize into CSV, JSON, XML.

[![Latest Stable Version](https://camo.githubusercontent.com/be1bdc43688fee6ba59dd208add4f8ffc2a13405426b8694cc2c1b55bb0834d7/68747470733a2f2f706f7365722e707567782e6f72672f73696777696e2f78657a696c61697265732f762f737461626c652e706e67)](https://github.com/sigwinhq/xezilaires-dev)[![Actions Status](https://github.com/sigwinhq/xezilaires-dev/workflows/Build/badge.svg)](https://github.com/sigwinhq/xezilaires-dev/actions)[![PHPStan enabled](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/phpstan/phpstan)[![Psalm enabled](https://camo.githubusercontent.com/ad56256f9a08d2b16ff1ca8828e27b8153bbccfd0e49d3b247e5ae615199e799/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5073616c6d2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/vimeo/psalm)

What it does
------------

[](#what-it-does)

1. we create a PHP class which will hold our Excel row data
2. we next create spreadsheet iterator instance
    1. passing the path to the Excel file we wish to read
    2. passing the configuration mapping the Excel columns into PHP properties
3. as we're iterating, we are getting an value object (instance of the defined class) for each row

Think of it as an "ORM" *(Object Relation Manager)* for an Excel file. An OEM *(Object Excel Manager)*, if you will.

Example usage
-------------

[](#example-usage)

### Without attributes

[](#without-attributes)

```
class Product
{
    private $name;
}

$symfonySerializer = new \Symfony\Component\Serializer\Serializer([
    new \Symfony\Component\Serializer\Normalizer\PropertyNormalizer(),
]);
$normalizer = new \Xezilaires\Bridge\Symfony\Serializer\ObjectSerializer($symfonySerializer);
$iteratorFactory = new \Xezilaires\SpreadsheetIteratorFactory($normalizer, [
    \Xezilaires\Bridge\PhpSpreadsheet\Spreadsheet::class,
]);

$iterator = $iteratorFactory->fromFile(
    // https://github.com/sigwinhq/xezilaires-dev/raw/master/src/Xezilaires/Test/resources/fixtures/products.xlsx
    new \SplFileObject(__DIR__.'/../../src/Xezilaires/Test/resources/fixtures/products.xlsx'),
    new \Xezilaires\Metadata\Mapping(
        Model\Product::class,
        [
            'name' => new \Xezilaires\Metadata\ColumnReference('A'),
        ],
        [
            // options
            'start' => 2,
        ]
    )
);
```

### With attributes

[](#with-attributes)

```
use Xezilaires\Attribute as XLS;

#[XLS\Options(header=1, start=2)]
class Product
{
    #[@XLS\HeaderReference(header="Name")]
    private $name;
}

$symfonySerializer = new \Symfony\Component\Serializer\Serializer([
    new \Symfony\Component\Serializer\Normalizer\PropertyNormalizer(),
]);
$normalizer = new \Xezilaires\Bridge\Symfony\Serializer\ObjectSerializer($symfonySerializer);
$iteratorFactory = new \Xezilaires\SpreadsheetIteratorFactory($normalizer, [
    \Xezilaires\Bridge\PhpSpreadsheet\Spreadsheet::class,
]);
$attributeDriver = new \Xezilaires\Metadata\Attribute\AttributeDriver();

$iterator = $iteratorFactory->fromFile(
    // https://github.com/sigwinhq/xezilaires-dev/raw/master/src/Xezilaires/Test/resources/fixtures/products.xlsx
    new \SplFileObject(__DIR__.'/../../src/Xezilaires/Test/resources/fixtures/products.xlsx'),
    $attributeDriver->getMetadataMapping(Product::class, ['reverse' => true])
);
```

See more examples in the [`docs/examples/`](./docs/examples/) folder.

Options
-------

[](#options)

- `start`, which row do we start on
    *(integer, optional, default: `1`)*
- `header`, which row contains the header labels
    *(integer, optional if not using `HeaderReference`, default: `null`)*
- `reverse`, do we iterate the rows in reverse, from end to start
    *(boolean, optional, default: `false`)*
- `sequential`, is the key sequential (0, 1, 2) or represents current row?
    *(boolean, optional, default: `false`)*

Features
--------

[](#features)

Features included:

- **Reading Excel files**
    *(using either `phpoffice/PhpSpreadsheet` or `openspout/openspout`)*
- **Denormalization / normalization** support
    *(using `symfony/serializer`, from / to all supported formats)*
- Attributes support
- mapping via **column names** or **header labels**
    *(saying "Map header label `PrdctEN` to property `product`")*
- **A Symfony bundle**
    *(for easy integration into existing apps)*
- CLI *(command-line interface)* tool

Custom normalizers / validators
-------------------------------

[](#custom-normalizers--validators)

You can use your own normalizers / validators by passing your own Symfony bundle which registers them to the Xezilaires commands via `--bundle`, like so:

```
vendor/bin/xezilaires validate --bundle Xezilaires\\Test\\ExampleBundle\\XezilairesExampleBundle Xezilaires\\Test\\Model\\Product src/Xezilaires/Test/resources/fixtures/products.xlsx

```

See example bundle in [`src/Xezilaires/Test/ExampleBundle/`](./src/Xezilaires/Test/ExampleBundle/).

What's with the name
--------------------

[](#whats-with-the-name)

`xezilaires` is `serializex` backwards.

We added the X so the name so we can shorten it as [XLS](https://fileinfo.com/extension/xls). As a side-effect, we [made reading Excel files with this library cool](https://tvtropes.org/pmwiki/pmwiki.php/Main/XMakesAnythingCool).

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance24

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

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

Recently: every ~69 days

Total

18

Last Release

834d ago

Major Versions

0.6.7 → 1.0.02024-01-29

PHP version history (5 changes)0.1.0PHP &gt;= 7.2.0

0.4.0PHP ^7.3 || ^8.0

0.6.1PHP ^8.0

0.6.4PHP ^8.1

1.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fc027d87011b9b66dabfe0acfa0a074408ecf4963632750fbfdd611148396c9?d=identicon)[dkarlovi](/maintainers/dkarlovi)

---

Top Contributors

[![dkarlovi](https://avatars.githubusercontent.com/u/209225?v=4)](https://github.com/dkarlovi "dkarlovi (205 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

csv-exporthacktoberfestiteratorjson-exportnormalizationphpphp-toolsserializable-objectsserializationspreadsheetspreadsheet-dataspreadsheet-mapperspreadsheetsvalidationxml-export

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sigwin-xezilaires-dev/health.svg)

```
[![Health](https://phpackages.com/badges/sigwin-xezilaires-dev/health.svg)](https://phpackages.com/packages/sigwin-xezilaires-dev)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[jschaedl/iban-validation

A small library for validating International BankAccount Numbers (IBANs).

1022.8M16](/packages/jschaedl-iban-validation)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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