PHPackages                             szczyglis/ultimate-chain-parser - 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. szczyglis/ultimate-chain-parser

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

szczyglis/ultimate-chain-parser
===============================

A comprehensive modular working in-chain tools for advanced text-data processing and re-parsing

v1.2.13(1y ago)691MITPHPPHP ^7.2.5 || ^8.0

Since Apr 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/szczyglis-dev/ultimate-chain-parser)[ Packagist](https://packagist.org/packages/szczyglis/ultimate-chain-parser)[ Docs](https://github.com/szczyglis-dev/ultimate-chain-parser)[ RSS](/packages/szczyglis-ultimate-chain-parser/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (8)Dependencies (5)Versions (8)Used By (0)

Release: **1.2.13** | build: **2024.08.26** | PHP: **^7.2.5|^8.0**

Ultimate Chain Parser - advanced chain-flow-based parser
========================================================

[](#ultimate-chain-parser---advanced-chain-flow-based-parser)

**Ultimate Chain Parser is a modular package designed for chain processing of text data, converting it into structured output.**The application concept is based on processing data in successive iterations using configurable data processing modules. Each module in the execution chain sequentially accesses the output of the preceding module and uses it as input.

How to install
--------------

[](#how-to-install)

```
composer require szczyglis/ultimate-chain-parser

```

**For what purposes can the Ultimate Chain Parser be used?**

- Processing any data broken into inconsistent rows or columns into a standardized format (e.g., CSV).
- Re-parsing data according to specific complex patterns.
- Creating datasets that are easy to insert into a database or import into software like Excel.
- Performing complex text manipulation.
- ...and many other tasks.

Live Demo:
--------------------------------------------------------

[](#live-demo-httpsszczyglisdevultimate-chain-parser)

[![parser2](https://user-images.githubusercontent.com/61396542/164573563-e034b324-37e2-4742-a120-fd8a90324708.png)](https://user-images.githubusercontent.com/61396542/164573563-e034b324-37e2-4742-a120-fd8a90324708.png)

Features
========

[](#features)

- Re-parsing poorly arranged data into structured, clean datasets (e.g., CSV)
- Parsing poorly arranged or broken data copied from websites, Word documents, or PDFs
- Running pre-configured tools (plugins) in a sequence
- Performing complex text data manipulations
- Parsing complex data using programmable regular expressions executed in a defined sequence
- Featuring an easy-to-use and powerful configuration system
- Executing actions through splitting tasks into smaller, separate tools, each performing a different batch of tasks in cooperation with the rest
- Including tools that can work separately or together: parser, cleaner, limiter, and replacer
- Offering a modular structure based on a plug-in system, with each element extendable or replaceable by custom implementations; every component has its own interface for extending functionality or replacing existing ones
- Providing multiple extendable components: configuration providers, input data readers, data parsers, renderers, loggers, etc.
- Including an HTML/AJAX-based configurator application for real-time testing and configuration
- Featuring a command-line tool for ease of use
- Easy integration with modern frameworks like Symfony

Requirements:
=============

[](#requirements)

- PHP 7.2.5+ or PHP 8.0+
- Composer -

Example of an Action
====================

[](#example-of-an-action)

**Sample text data that requires processing:**

```
123
terminator
schwarzenegger

action movie

very good

456
titanic

dicaprio

same director

```

**Ugly, right? The Ultimate Chain Parser can transform such inconsistently arranged data into a structured format such as CSV, JSON, raw PHP array, or any other schema easily defined by the user:**

```
123,terminator,schwarzenegger,action movie very good
456,titanic,dicaprio,same director

```

```
[
    [
        {
            "id": "123",
            "title": "terminator",
            "actor": "schwarzenegger",
            "description": "action movie very good"
        },
        {
            "id": "456",
            "title": "titanic",
            "actor": "dicaprio",
            "description": "same director"
        }
    ]
]

```

The above CSV and JSON data has been generated completely automatically using only a few configuration options provided in the parser input. The main concept behind the operation is to run a set of processing tools (called Plugins) in a chain. Each successively started process accesses the output from the previous process in the chain. Each of these chain elements can be freely configured with different options. Configuration can be done in many ways: by running Chain Parser directly from your code, loading configuration from an external file and running from the command line, or completely live using the Ajax web form-based configurator included in the package. Ultimate Chain Parser can also directly return a ready (not parsed) dataset prepared from analyzed data (in the form of a PHP array or JSON data).

Installation
============

[](#installation)

**Composer / packagist**

```
composer require szczyglis/ultimate-chain-parser

```

**Manual installation**

- Download the zip package and extract it.
- Run `composer install` in the project directory to install dependencies.
- Include the Composer autoloader in your application and instantiate the `ChainParser` object.

Example of use
==============

[](#example-of-use)

```
