PHPackages                             wilsonglasser/spout - 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. wilsonglasser/spout

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

wilsonglasser/spout
===================

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

v3.0.21(3mo ago)558.7k—7.6%5Apache-2.0PHPPHP &gt;=5.6.0

Since Mar 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/wilsonglasser/spout)[ Packagist](https://packagist.org/packages/wilsonglasser/spout)[ Docs](https://www.github.com/box/spout)[ RSS](/packages/wilsonglasser-spout/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (24)Used By (0)

Spout
=====

[](#spout)

This version
------------

[](#this-version)

This fork is a modified version of Spout v3.0, with the ability to add merge cells, comment, formula cells, column dimensions and auto filter for XLSX Writer.

About
-----

[](#about)

Spout is a PHP library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way. Contrary to other file readers or writers, it is capable of processing very large files while keeping the memory usage really low (less than 3MB).

Join the community and come discuss about Spout: [![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/box/spout?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

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

[](#documentation)

Sorry but I can't create a documentation for the new methods at the moment.

I will just list the small examples:

**Merge cells**

```
$worksheet = $writer->getCurrentSheet();
$worksheet->mergeCells('A1:B1');
```

**Row Height**

```
$rowStyle = (new StyleBuilder())
    ->setFontSize(10)
    ->setFontName('Arial')
    ->setRowHeight(50)
    ->build();
$writer->addRow(new Row([new Cell('Hello World')], $rowStyle));
```

**Column Dimension (Width)**

```
// Specific size
$worksheet->addColumnDimension(
    new ColumnDimension('A', 50 )
);

// Autosize
$worksheet->addColumnDimension(new ColumnDimension(
    'A',
    -1,
    true
));
```

**Auto Filter**

Enable excel auto filters

```
$worksheet = $writer->getCurrentSheet();
$worksheet->setAutoFilter('A1:Z1');
```

**Formula value**

Added support to show a calculated value for a formula (Will not calculate, you need to pass the correct value)

```
$Cell = new Cell('=A1', null);
$Cell->setCalculatedValue('100.00');
```

**Number Format**

```
$originalValue = 100.0;
$value = 'R$'.number_format($originalValue, 2,',','.');
$style = (new StyleBuilder())
        ->setFontSize(10)
        ->setFontName('Arial')
        ->setNumberFormat(new NumberFormat('0 - "' . $value . '"'))
        ->build();
$Cell = new Cell($value, $style);
// date
$styleMonthYear =  (new StyleBuilder())
    ->setFontSize(10)
    ->setFontName('Arial')
    ->setNumberFormat(new NumberFormat('MM/YYYY'))
    ->build();
```

**Comments**

```
$worksheet = $writer->getCurrentSheet();
$worksheet->addComment(
    new Comment('A1', 'My comment', 'Comment user, null for nothing')
);
```

**Column Index from Cell Index**

Returns the column index (base 10) associated to the base 26 cell index.

Excel uses A to Z letters for column indexing, where A is the 1st column, Z is the 26th and AA is the 27th.

The mapping is zero based, so that 0 maps to A, B maps to 1, Z to 25 and AA to 26.

```
// echo 0
echo CellHelper::getColumnToIndexFromCellIndex('A1');
```

Spout Full documentation can be found at .

Requirements
------------

[](#requirements)

- PHP version 5.6 or higher
- PHP extension `php_zip` enabled
- PHP extension `php_xmlreader` enabled

Support
-------

[](#support)

I will not offer full support for this fork, this is just a fork for a specific project.

Copyright and License
---------------------

[](#copyright-and-license)

Copyright 2017 Box, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance80

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

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

Recently: every ~186 days

Total

20

Last Release

104d ago

### Community

Maintainers

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

---

Top Contributors

[![adrilo](https://avatars.githubusercontent.com/u/7086917?v=4)](https://github.com/adrilo "adrilo (234 commits)")[![madflow](https://avatars.githubusercontent.com/u/183248?v=4)](https://github.com/madflow "madflow (35 commits)")[![wilsonglasser](https://avatars.githubusercontent.com/u/342362?v=4)](https://github.com/wilsonglasser "wilsonglasser (32 commits)")[![sfichera](https://avatars.githubusercontent.com/u/3146077?v=4)](https://github.com/sfichera "sfichera (4 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (3 commits)")[![KiNgMaR](https://avatars.githubusercontent.com/u/438358?v=4)](https://github.com/KiNgMaR "KiNgMaR (2 commits)")[![Lewiscowles1986](https://avatars.githubusercontent.com/u/2605791?v=4)](https://github.com/Lewiscowles1986 "Lewiscowles1986 (2 commits)")[![lichunqiang](https://avatars.githubusercontent.com/u/2433916?v=4)](https://github.com/lichunqiang "lichunqiang (1 commits)")[![camuthig](https://avatars.githubusercontent.com/u/5178217?v=4)](https://github.com/camuthig "camuthig (1 commits)")[![nimmneun](https://avatars.githubusercontent.com/u/5374300?v=4)](https://github.com/nimmneun "nimmneun (1 commits)")[![philipbrown](https://avatars.githubusercontent.com/u/1579059?v=4)](https://github.com/philipbrown "philipbrown (1 commits)")[![rlukasz](https://avatars.githubusercontent.com/u/10188984?v=4)](https://github.com/rlukasz "rlukasz (1 commits)")[![someson](https://avatars.githubusercontent.com/u/3097223?v=4)](https://github.com/someson "someson (1 commits)")[![stianlik](https://avatars.githubusercontent.com/u/410251?v=4)](https://github.com/stianlik "stianlik (1 commits)")[![WebsourceCz](https://avatars.githubusercontent.com/u/676930?v=4)](https://github.com/WebsourceCz "WebsourceCz (1 commits)")[![welcoMattic](https://avatars.githubusercontent.com/u/773875?v=4)](https://github.com/welcoMattic "welcoMattic (1 commits)")[![yannickroger](https://avatars.githubusercontent.com/u/4035241?v=4)](https://github.com/yannickroger "yannickroger (1 commits)")[![eusonlito](https://avatars.githubusercontent.com/u/644551?v=4)](https://github.com/eusonlito "eusonlito (1 commits)")[![garak](https://avatars.githubusercontent.com/u/179866?v=4)](https://github.com/garak "garak (1 commits)")[![glukkkk](https://avatars.githubusercontent.com/u/4921422?v=4)](https://github.com/glukkkk "glukkkk (1 commits)")

---

Tags

streamphpexcelxlsxcsvmemoryodfofficeOOXMLspreadsheetodsopenreadwritescale

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/wilsonglasser-spout/health.svg)

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

###  Alternatives

[openspout/openspout

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

1.2k57.6M131](/packages/openspout-openspout)

PHPackages © 2026

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