Skip to content

Commit 74b2b72

Browse files
committed
Docs: Improve README.md
1 parent 2adb322 commit 74b2b72

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

README.md

+24-12
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ and you're looking for a PHP library to do the stuff.
1010

1111
Alright, let's go!
1212

13+
`bentools-etl` is a versatile PHP library for implementing the Extract, Transform, Load (ETL) pattern, designed to streamline data processing tasks.
14+
1315
Installation
1416
------------
1517

1618
```bash
1719
composer require bentools/etl:^4.0@alpha
1820
```
1921

20-
_Warning: version 4.0 is a complete rewrite and a involves important BC breaks._
22+
> **Warning #1**: Version 4.0 is a complete rewrite and introduces significant BC (backward compatibility) breaks.
23+
> Avoid upgrading from `^2.0` or `^3.0` unless you're fully aware of the changes.
24+
25+
> **Warning #2**: Version 4.0 is still at an alpha stage. BC breaks might occur between alpha releases.
2126
22-
_Don't upgrade from `^2.0` or `^3.0` unless you know what you're doing!_
2327

2428
Usage
2529
-----
@@ -34,16 +38,22 @@ Now let's have a look on how simple it is:
3438
```php
3539
use BenTools\ETL\EtlExecutor;
3640

41+
// Given
42+
$singers = ['Bob Marley', 'Amy Winehouse'];
43+
44+
// Transform each singer's name to uppercase and process the array
3745
$etl = (new EtlExecutor())
3846
->transformWith(fn (string $name) => strtoupper($name));
3947

40-
$singers = ['Bob Marley', 'Amy Winehouse'];
48+
// When
4149
$report = $etl->process($singers);
42-
dump($report->output); // ["BOB MARLEY", "AMY WINEHOUSE"]
50+
51+
// Then
52+
var_dump($report->output); // ["BOB MARLEY", "AMY WINEHOUSE"]
4353
```
4454

45-
OK, that wasn't really hard, here we basically don't have to extract anything (we can already iterate on `$singers`),
46-
and we're not loading anywhere, except into PHP's memory.
55+
OK, that wasn't really hard, here we basically don't have to _extract_ anything (we can already iterate on `$singers`),
56+
and we're not _loading_ anywhere, except into PHP's memory.
4757

4858
Now let's take this to the next level:
4959

@@ -99,7 +109,8 @@ The `CSVExtractor` has some options to _read_ the data, such as considering that
99109
Creating your own Extractor / Transformers / Loaders
100110
--------------------------------------------------
101111

102-
You can implement `ExtractorInterface`, `TransformerInterface` and `LoaderInterface`, or basically use simple `callable` with the same signatures.
112+
You can implement `ExtractorInterface`, `TransformerInterface`, and `LoaderInterface`.
113+
Alternatively, use simple `callable` functions with the same signatures.
103114

104115
Here's another example:
105116
```php
@@ -151,7 +162,8 @@ But the last transformer of the chain (or your only one transformer) is determin
151162
Using events
152163
------------
153164

154-
The `EtlExecutor` emits various events during the workflow:
165+
The `EtlExecutor` emits a variety of events during the ETL workflow, providing insights and control over the process.
166+
155167
- `InitEvent` when `process()` was just called
156168
- `StartEvent` when extraction just started (we might know the total number of items to extract at this time, if the extractor provides this)
157169
- `ExtractEvent` upon each extracted item
@@ -197,7 +209,7 @@ Flush frequency and early flushes
197209
By default, the `flush()` method of your loader will be invoked at the end of the ETL,
198210
meaning it will likely keep all loaded items in memory before dumping them to their final destination.
199211

200-
Feel free to adjust a `flushFrequency` that fits your needs
212+
Feel free to adjust a `flushFrequency` that fits your needs to manage memory usage and data processing efficiency
201213
and optionally trigger an early flush at any time during the ETL process:
202214

203215
```php
@@ -237,8 +249,8 @@ $etl = $etl->onLoad(function (LoadEvent $event) {
237249
Recipes
238250
-------
239251

240-
Recipes are reusable configurations of an `EtlExecutor`.
241-
For example, to enable logging, use the `LoggerRecipe`:
252+
Recipes are pre-configured setups for `EtlExecutor`, facilitating reusable ETL configurations.
253+
For instance, `LoggerRecipe` enables logging for all ETL events.
242254

243255
```php
244256
use BenTools\ETL\EtlExecutor;
@@ -321,7 +333,7 @@ Contribute
321333
----------
322334

323335
Contributions are welcome!
324-
Before sending your PRs, run this command to ensure test pass and 100% of the code is covered.
336+
Please ensure to run tests using the command below and maintain 100% code coverage before submitting PRs.
325337

326338
```bash
327339
composer ci:check

0 commit comments

Comments
 (0)