oliverde8 / php-etl
A small etl coded in php, to extract/transform/load Edit with ease.
Fund package maintenance!
oliverde8
Installs: 5 995
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 2
Forks: 5
Open Issues: 7
Requires
- php: >=8.2
- oliverde8/associative-array-simplified: ^1.0
- psr/log: ^2.0|^3.0
- symfony/expression-language: ^6.0|^7.0
- symfony/filesystem: ^6.0|^7.0
- symfony/validator: ^6.0|^7.0
- symfony/yaml: ^6.0|^7.0
Requires (Dev)
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.6
- rector/rector: ^1.2
Suggests
- league/flysystem: For transfaring files from external file systems
- symfony/http-client: For a simple http request operation
- dev-master
- 2.0.x-dev
- v2.0.0-alpha2
- v2.0.0-alpha1
- v1.2.0-alpha3
- v1.2.0-alpha2
- v1.2.0-alpha1
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.1.0-alpha2
- v1.1.0-alpha1
- v1.0.2
- v1.0.1
- v1.0.0
- v0.4.0
- V0.3.0
- v0.2.0
- v0.1.0
- v0.0.3
- v0.0.2
- v0.0.1
- dev-dependabot/bundler/docs/webrick-1.8.2
- dev-dependabot/bundler/docs/rexml-3.3.9
- dev-web-page
- dev-feature/observatiblity
- dev-fixes
- dev-master-1.1.0
- dev-feature/simplified-etl
- dev-master-1.0.0
This package is auto-updated.
Last update: 2024-11-12 08:24:13 UTC
README
Php etl is a ETL that will allow transformation of data in a simple and efficient way.
It comes in 2 php components :
Rule engine
The rule engine allows to have configuration based transformations to transform a particular data.
This is integrated inside the ETL with the RuleTransformOperation
.
The rule engine can be used in standalone, see docs
The ETL Chain
An ETL chain is described by chain operations and Items. The chain operation holds the logic, this means it can:
- Extract data, (possibly duplicate the item)
- Transform data
- Load the data somewhere.
Data will propagate throught the ETL operations using Items, there can be different type of items (We will detail this later.)
Chain operations consumes one item in order to create a new item or an iterator. The purpose is to always process data individually. For example if we are importing customers we try to never have the data of more than one customer in memory.
Examples of how it works
We will have more detailed real use cases with sample data a bit further in the document.
In the simplest case the chains receive an iterator containing 2 items in input, both items are processed by each chain operation. This could be for example a list of customer. Each operation changes the items.
In the following example the iterator sends a single item. The first operation will then send GroupedItems containing 2 items. The first item could be a customer, and then we fetch each order of the customer in the operation1.
We can also group items, to make aggregations. The chain receives an iterator containg 2 items, the first operation processes both items. It breaks the chain for the first item, and returns an aggregation of item1 & item 2. This can be used to count the number of customers. This kind of grouping can use more memory and should therefore be used with care.
Chains can also be split, this would allow 2 different operations to be executed on the same item.
Creating a chain.
There are 2 ways of writing a chain, either you code it; or you describe the chain in a yaml file.
- Using php code to initiate each operation yourself, this is not recommended!
- Using yaml files to descrive the chain.
Please see the describe chains using yaml configurations, you can check the doc on sub chains and more complex cases as well
Creating you own operations.
Please refer to the Custom Opertions doc
FAQ
Please refer to the FAQ