PHPackages                             esmaeil/excelmapper - 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. esmaeil/excelmapper

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

esmaeil/excelmapper
===================

A PHP library that simplifies the process of mapping, parsing, and importing Excel data into your applications.

v1.0.0(1y ago)66MITPHPPHP ^8.0

Since Aug 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/esmaeilbahrani/excel-mapper)[ Packagist](https://packagist.org/packages/esmaeil/excelmapper)[ RSS](/packages/esmaeil-excelmapper/feed)WikiDiscussions master Synced 1mo ago

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

ExcelMapper
===========

[](#excelmapper)

ExcelMapper is a powerful and flexible PHP library designed to streamline the process of mapping, parsing, and importing data from Excel files into your applications. Whether you're dealing with simple spreadsheets or complex data structures, ExcelMapper provides an intuitive interface for transforming Excel data into a format that's easy to work with in your PHP projects.

Features
--------

[](#features)

- **Customizable Column Mappings**: Define how each column in your Excel file should be processed using custom or default parsers.
- **Seamless Integration**: Easily integrate with your existing PHP applications and workflows.
- **Powered by PHPSpreadsheet**: Leverages the robust capabilities of PHPSpreadsheet to handle Excel files.
- **Extensible Architecture**: Extend and customize the library to suit your specific needs.

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

[](#installation)

You can install ExcelMapper via Composer. Run the following command:

```
composer require esmaeil/excel-mapper
```

Usage
-----

[](#usage)

#### Basic Example

[](#basic-example)

Here’s how to use ExcelMapper to read an Excel file, process the data, and handle it with a custom callback:

```
use ExcelMapper\DataProcessor\ExcelDataProcessor;
use ExcelMapper\Readers\ExcelReader;
use ExcelMapper\Parsers\DefaultParser;

// Define custom column mapping
$mapping = [
    'A' => 'first_name',
    'B' => 'last_name',
    'C' => ['phone_number', DefaultParser::class],
];

// Read Excel file
$reader = new ExcelReader();
$sheetData = $reader->read('path_to_file.xlsx');

// Process the data
$processor = new ExcelDataProcessor();
$processor->process($sheetData, $mapping, function($mappedData) {
    // Handle the mapped data (e.g., save to database)
    print_r($mappedData);
});
```

### Custom Parsers

[](#custom-parsers)

If you need custom processing logic for specific columns, you can create your own parser by implementing the ColumnParserInterface.

```
use ExcelMapper\Interfaces\ColumnParserInterface;

class UppercaseParser implements ColumnParserInterface
{
    public function parse(mixed $value): mixed
    {
        return strtoupper($value);
    }
}
```

Then you can then use this custom parser in your column mappings:

```
$mapping = [
    ['first_name', UppercaseParser::class],
    ['last_name', UppercaseParser::class],
];
```

### Advanced Usage

[](#advanced-usage)

You can extend ExcelMapper further by integrating additional functionality or modifying the existing ones:

- Creating Custom Readers: Implement your own reader by following the ExcelReaderInterface.
- Extending Processors: Customize how data is processed by extending the ExcelDataProcessor.
- Column Mapping by Letter: Map Excel columns by their letter identifier, supporting both single-letter (e.g., 'A') and multi-letter (e.g., 'AA') columns.

### Testing

[](#testing)

To run tests, make sure you have PHPUnit installed. You can run the tests using the following command:

```
vendor/bin/phpunit
```

### Contributing

[](#contributing)

We welcome contributions! If you have ideas to improve this project or have found bugs, please open an issue or submit a pull request.

### License

[](#license)

ExcelMapper is licensed under the MIT License. See the LICENSE file for more details.

### Contact

[](#contact)

For any inquiries or support, feel free to reach out at .

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

629d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

phpexcelspreadsheetexcel-mapperdata-mapping

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/esmaeil-excelmapper/health.svg)

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

###  Alternatives

[openspout/openspout

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

1.1k57.6M128](/packages/openspout-openspout)[alexandrainst/php-xlsx-fast-editor

PHP library to make basic but fast read &amp; write operations on existing Excel workbooks

1311.4k](/packages/alexandrainst-php-xlsx-fast-editor)

PHPackages © 2026

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