PHPackages                             the-pantry/lightweight-spreadsheet - 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. the-pantry/lightweight-spreadsheet

ActiveLibrary

the-pantry/lightweight-spreadsheet
==================================

A lightweight php library for reading spreadsheet files

v1.0.1(1mo ago)134↓66.7%MITPHPPHP ^8.4CI passing

Since Jul 19Pushed 1mo agoCompare

[ Source](https://github.com/The-Pantry-App/lightweight-spreadsheet)[ Packagist](https://packagist.org/packages/the-pantry/lightweight-spreadsheet)[ RSS](/packages/the-pantry-lightweight-spreadsheet/feed)WikiDiscussions main Synced 2w ago

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

[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine/)

Lightweight Spreadsheet
=======================

[](#lightweight-spreadsheet)

[![GitHub Stars](https://camo.githubusercontent.com/b5c9612cb94be7ead31f17d8d85dc8440b7ab616d2b4509097601aab11c30e4a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f5468652d50616e7472792d4170702f6c696768747765696768742d73707265616473686565742e7376673f7374796c653d666c61742d737175617265)](https://github.com/The-Pantry-App/lightweight-spreadsheet/stargazers)[![GitHub Issues](https://camo.githubusercontent.com/45fdeebc858975ebf9d80c0a898f06071696d10c5ccb7fbc033a35f367f684d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f5468652d50616e7472792d4170702f6c696768747765696768742d73707265616473686565742e7376673f7374796c653d666c61742d737175617265)](https://github.com/The-Pantry-App/lightweight-spreadsheet/issues)[![PHP Tests](https://camo.githubusercontent.com/f4eeb17487bac90dca4b590aba85c36d3e22253849ebe0da8dcd343b6f56b0ae/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f5468652d50616e7472792d4170702f6c696768747765696768742d73707265616473686565742f7068702e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/The-Pantry-App/lightweight-spreadsheet/actions/workflows/php.yml)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist](https://camo.githubusercontent.com/325c4d0e73a1f7bb1e5c5a9026ed6fed05e1e299b0fa7cd6fff38de75b9e282a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7468652d70616e7472792f6c696768747765696768742d73707265616473686565742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/the-pantry/lightweight-spreadsheet)[![Downloads](https://camo.githubusercontent.com/ae6519497dbbae687971d6a44ac6fe4e657ddc263adf58ab6755cf0719221aea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468652d70616e7472792f6c696768747765696768742d73707265616473686565742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/the-pantry/lightweight-spreadsheet)[![PHP Version](https://camo.githubusercontent.com/9385751917faf3cc18e8e0727f7e6a5525b84ed79a8c1c4616e41b5528fc084d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7468652d70616e7472792f6c696768747765696768742d73707265616473686565743f7374796c653d666c61742d737175617265)](https://packagist.org/packages/the-pantry/lightweight-spreadsheet)

A lightweight PHP library for reading spreadsheet files with a focus on low memory usage and simplicity.

Features
--------

[](#features)

- **XLSX Support**: Read modern Excel files.
- **Generator Based**: Uses PHP Generators to iterate over sheets and rows, keeping memory usage low.
- **Simple API**: Easy to use interface for accessing data.
- **PHP 8.4+ Ready**: Built with the latest PHP features.

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

[](#requirements)

- **PHP**: ^8.4
- **Extensions**: `ext-xmlreader`, `ext-zip`

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

[](#installation)

To install, use composer:

```
composer require the-pantry/lightweight-spreadsheet
```

Usage
-----

[](#usage)

### Opening a Spreadsheet

[](#opening-a-spreadsheet)

```
use ThePantry\LightweightSpreadsheet\SpreadsheetReader;

$spreadsheet = SpreadsheetReader::open('path/to/spreadsheet.xlsx');
```

### Iterating through Sheets, Rows, and Cells

[](#iterating-through-sheets-rows-and-cells)

```
foreach ($spreadsheet->getSheets() as $sheet) {
    echo "Sheet: " . $sheet->name . PHP_EOL;

    foreach ($sheet->getRows() as $row) {
        foreach ($row->getCells() as $cell) {
            echo "Cell " . $cell->coordinate->toString() . ": " . $cell->value . PHP_EOL;
        }
    }
}
```

### Accessing a Specific Sheet or Row

[](#accessing-a-specific-sheet-or-row)

```
$sheet = $spreadsheet->getSheetByName('Sheet1');
$row = $sheet?->getRow(1);
```

### Accessing a Specific Cell

[](#accessing-a-specific-cell)

```
$sheet = $spreadsheet->getSheetByName('Sheet1');
$cell = $sheet?->getCell('A1');

echo "Cell " . $cell->coordinate->toString() . ": " . $cell->value . PHP_EOL;
```

Project Structure
-----------------

[](#project-structure)

- `src/`: Library source code.
    - `Spreadsheet/`: Core spreadsheet logic and formats.
    - `SpreadsheetReader.php`: Main entry point.
- `tests/`: Unit and integration tests.

Development Scripts
-------------------

[](#development-scripts)

The following scripts are available via Composer:

- **Run Tests**: `composer run test`
- **Static Analysis**: `composer run analyse`
- **Check Code Style**: `composer run cs-check`
- **Fix Code Style**: `composer run cs-fix`

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance91

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

2

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62e57b46dbf6b7b1b27e806e9ae909d26b9269c25cd0e8371a5e0efdb6a89d01?d=identicon)[jbtcd](/maintainers/jbtcd)

---

Top Contributors

[![jbtcd](https://avatars.githubusercontent.com/u/30057274?v=4)](https://github.com/jbtcd "jbtcd (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/the-pantry-lightweight-spreadsheet/health.svg)

```
[![Health](https://phpackages.com/badges/the-pantry-lightweight-spreadsheet/health.svg)](https://phpackages.com/packages/the-pantry-lightweight-spreadsheet)
```

PHPackages © 2026

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