PHPackages                             torol/torol - 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. torol/torol

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

torol/torol
===========

A simple and elegant ETL (Extract, Transform, Load) library for PHP.

v1.0.0(10mo ago)1603MITPHPPHP ^8.1

Since Jun 28Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/zepzeper/torol)[ Packagist](https://packagist.org/packages/torol/torol)[ RSS](/packages/torol-torol/feed)WikiDiscussions master Synced 1mo ago

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

Torol: A Simple and Elegant ETL Library for PHP
===============================================

[](#torol-a-simple-and-elegant-etl-library-for-php)

Torol is a modern, memory-efficient, and highly readable ETL (Extract, Transform, Load) library for PHP. Inspired by the simplicity of Laravel Collections, Torol provides a fluent, chainable API to build powerful data processing pipelines with minimal effort.

It's designed to handle large datasets with ease by processing data row-by-row using PHP Generators, ensuring a low memory footprint regardless of the data size.

Why Choose Torol?
-----------------

[](#why-choose-torol)

- **Fluent &amp; Readable API**: Chain methods together to create clean and self-documenting data pipelines.
- **Memory Efficient**: Built with generators to process massive files (CSV, JSON, XML) without running out of memory.
- **Easily Extensible**: Add your own custom data sources (Extractors) and destinations (Loaders) with a simple interface.
- **Rich Transformations**: A comprehensive set of transformation methods to cover the most common data manipulation tasks.
- **Modern &amp; Tested**: Built for modern PHP (^8.1+) and comes with a thorough test suite.

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

[](#installation)

You can install Torol via Composer.

```
composer require torol/torol
```

### Optional Dependencies

[](#optional-dependencies)

Torol is modular. To use certain extractors, you may need to install additional packages.

```
# To use the ExcelExtractor
composer require phpoffice/phpspreadsheet

# To use the S3Extractor
composer require aws/aws-sdk-php

# For making API requests with ApiExtractor
composer require guzzlehttp/guzzle
```

Quick Start
-----------

[](#quick-start)

Here's a simple example of how to read user data from a CSV file, add a new column, filter for active users, and then load the results into a new JSON file.

Assume you have a `users.csv` file:

```
id,name,email,status
1,John Doe,john@example.com,active
2,Jane Smith,jane@example.com,inactive
3,Peter Jones,peter@example.com,active
```

Now, let's process it with Torol:

```
