PHPackages                             julesgraus/quatsch - 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. julesgraus/quatsch

ActiveLibrary

julesgraus/quatsch
==================

0.0.1(9mo ago)11PHPPHP ^8.4

Since Aug 4Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/julesgraus/quatsch)[ Packagist](https://packagist.org/packages/julesgraus/quatsch)[ RSS](/packages/julesgraus-quatsch/feed)WikiDiscussions main Synced 1mo ago

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

Quatsch
=======

[](#quatsch)

A fast, easy, memory-efficient tool to load data, extract data, transform data, store data from and to different sources. While providing tools to make that process as easy as possible, but extensible as possible.

The goal of this package is to help you manipulate data in a way it makes sense again. Turning Quatsch (Nonsense) into something data that makes sense and has value to you.

The next code, for example, opens a file, extracts data from it using a regex pattern, and stores the extracted.

```
use \JulesGraus\Quatsch\Pattern\Pattern;
use \JulesGraus\Quatsch\Pattern\Enums\RegexModifier;
use \JulesGraus\Quatsch\Pattern\StringPatternInspector;
use \JulesGraus\Quatsch\Tasks\ExtractTask;
use \JulesGraus\Quatsch\Tasks\Enums\FileMode;
use \JulesGraus\Quatsch\Resources\FileResource;
use \JulesGraus\Quatsch\ResourceAlgorithms\SlidingWindowChunkProcessor

$errorPattern = Pattern::contains(Pattern::quote('['))
    ->digit()->times(4)
    ->then('-')
    ->digit()->times(2)
    ->then('-')
    ->digit()->times(2)
    ->then(' ')
    ->digit()->times(2)
    ->then(':')
    ->digit()->times(2)
    ->then(':')
    ->digit()->times(2)
    ->then(Pattern::quote(']'))
    ->singleCharacter()->oneOrMoreTimes()
    ->multiLineEndOfString()
    ->addModifier(RegexModifier::MULTILINE)
    ->addModifier(RegexModifier::GLOBAL);

$inputResource = new FileResource(
    path: __DIR__ . '/../fixtures/laravel.log',
    mode: FileMode::READ,
);

$outputResource = new FileResource(
    path: __DIR__ . '/../fixtures/laravel_parsed.log',
    mode: FileMode::READ_APPEND,
);

$task = new ExtractTask(
    patternToExtract: $errorPattern,
    slidingWindowChunkProcessor: new SlidingWindowChunkProcessor(
        chunkSize: 20,
        maximumExpectedMatchLength: 1000,
        stringPatternInspector: new StringPatternInspector(),
    ),
);

$task(inputResource: $inputResource, outputResourceOrOutputRedirector: $outputResource);
```

Practical use cases
-------------------

[](#practical-use-cases)

In this package you can fluently build regexes. These regexes can be used in tasks that, for example, extract, replace, or manipulate data in different ways. Data is passed to and returned from Tasks using resource classes. A FileResource could, for example, be used to open and read a log file. And another file resource to store the result of your task.

Components and Features
-----------------------

[](#components-and-features)

- [Fluent Regexes](./documentation/regex/regex.md)
- [Tasks](./documentation/tasks/tasks.md)
- [Resources](./documentation/resources/resources.md)
- [JsonPath](./documentation/json_path/json_path.md)

Examples
--------

[](#examples)

You can find some examples in the examples directory.

Troubleshooting
---------------

[](#troubleshooting)

### I try to extract patterns up till the end of the line, but it stops earlier than the end of the line.

[](#i-try-to-extract-patterns-up-till-the-end-of-the-line-but-it-stops-earlier-than-the-end-of-the-line)

*Possible solution 1:*When the chunk size is set to the length of half of a line you are trying to extract, it will see the end of the chunk as the end of the line. Just choose a chunk length, bigger than the longest line of your file.

### I use a resource with file mode FileMode::READ\_APPEND (a+) when using a task on it, it hangs indefinitely.

[](#i-use-a-resource-with-file-mode-filemoderead_append-a-when-using-a-task-on-it-it-hangs-indefinitely)

This file mode places the file pointer at the end of the file. Try FileMode::READ\_WRITE (r+) so it can start reading from the beginning. Don't for get to check if the resource is seekable and rewind it to the beginning.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance57

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

286d ago

### Community

Maintainers

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

---

Top Contributors

[![julesgraus](https://avatars.githubusercontent.com/u/4387442?v=4)](https://github.com/julesgraus "julesgraus (35 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/julesgraus-quatsch/health.svg)

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

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[api-platform/metadata

API Resource-oriented metadata attributes and factories

223.5M96](/packages/api-platform-metadata)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[flowwow/cloudpayments-php-client

cloudpayments api client

2188.2k](/packages/flowwow-cloudpayments-php-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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