PHPackages                             oskargunther/excel-writer - 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. oskargunther/excel-writer

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

oskargunther/excel-writer
=========================

OOP lightweight Excel Writer

0.5.4(6y ago)01.8kMITPHPPHP &gt;=7.1

Since Nov 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/oskargunther/excel-writer)[ Packagist](https://packagist.org/packages/oskargunther/excel-writer)[ RSS](/packages/oskargunther-excel-writer/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (19)Used By (0)

Lightweight PHP &gt;7.1 Excel Writer
====================================

[](#lightweight-php-71-excel-writer)

```
This library uses https://github.com/mk-j/PHP_XLSXWriter as engine
It's only OOP wrapper

As the engine, this library don't waste memory and is written for fast generation of huge sheets

```

### Installation

[](#installation)

```
composer require oskargunther/excel-writer

```

### Symfony &gt; 2.8

[](#symfony--28)

```
    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = [
                ....
                new \ExcelWriterBundle\ExcelWriterBundle(),
            ];

        }
    }
```

### Example of usage

[](#example-of-usage)

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

use ExcelWriter\Writer;
use ExcelWriter\Model\HeaderCell;
use ExcelWriter\Model\CellStyle;
use ExcelWriter\Model\Cell;

$writer = Writer::createWriter();

// Writing headers
$headerCellStyle = new CellStyle();
$headerCellStyle->setColor('#FFF');
$headerCellStyle->setFill('#000');

$sheet = 'example';
$header = new Header();
$header
    ->setAutoFilter(true)
    ->setFreezeColumns(0)
    ->setFreezeRows(1)
    ->createCell('Column1', HeaderCell::TYPE_STRING, $headerCellStyle)
    ->addCell((new HeaderCell('Column2', HeaderCell::TYPE_DATETIME, $headerCellStyle))->setColumnWidth(20));

Writer::writeHeaderRow($writer, $sheet, $header);

// Writing data
$data = [
    ['Value1', date('Y-m-d H:i:s')],
    ['Value2', date('Y-m-d H:i:s')]
];
$column2Style = new CellStyle();
$column2Style->setFontStyle(CellStyle::FONT_STYLE_BOLD, CellStyle::FONT_STYLE_ITALIC);
$column2Style->setBorderStyle(CellStyle::BORDER_STYLE_DOTTED);
$column2Style->setBorder(CellStyle::BORDER_BOTTOM, CellStyle::BORDER_LEFT);

foreach ($data as $dataRow) {
    $row = new Row();

    $row
        ->setHeight(30)
        ->createCell($dataRow[0])
        ->addCell((new Cell($dataRow[1], $column2Style)));

    Writer::writeRow($writer, $sheet, $row);
}

// Saving file
Writer::writeToFile($writer, 'example.xlsx');
```

[Example .xlsx File](https://github.com/oskargunther/excel-writer/raw/master/examples/example.xlsx)

### Using service

[](#using-service)

```
$writer = new \ExcelWriterBundle\Service\ExcelWriterService();
// or
$writer = $this->container->get('excel_writer.service');
// Symfony service is not shared so every instance have it's own writer

$writer->writeHeaderRow(...);
$writer->writeRow(...);
$writer->save($filename);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

18

Last Release

2352d ago

### Community

Maintainers

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

---

Top Contributors

[![oskargunther](https://avatars.githubusercontent.com/u/23240953?v=4)](https://github.com/oskargunther "oskargunther (1 commits)")

### Embed Badge

![Health badge](/badges/oskargunther-excel-writer/health.svg)

```
[![Health](https://phpackages.com/badges/oskargunther-excel-writer/health.svg)](https://phpackages.com/packages/oskargunther-excel-writer)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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