PHPackages                             weby/sloth - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. weby/sloth

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

weby/sloth
==========

Data manipulaton tool

v0.1(5y ago)4171MITPHPPHP ^7.0CI failing

Since Jul 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/maximiliamus/weby-sloth)[ Packagist](https://packagist.org/packages/weby/sloth)[ Docs](https://github.com/maximiliamus/weby-sloth)[ RSS](/packages/weby-sloth/feed)WikiDiscussions master Synced 4d ago

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

Weby\\Sloth
-----------

[](#webysloth)

This PHP's library provides simple data manipulaton tools and may be used for simple data analysis, transforming and reporting. For example, it provides such operations for input data as "group by", "pivot" and additional aggregate functions that may be applied to this operations.

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

[](#installation)

```
composer require weby/sloth:v0.1
```

Usage
-----

[](#usage)

See [examples](https://github.com/maximiliamus/weby-sloth/tree/master/examples) folder for more info.

### Input data

[](#input-data)

```
// examples/data.php:
$data = [
    ['foo' => 'one', 'bar' => 'A', 'baz' => 1],
    ['foo' => 'one', 'bar' => 'B', 'baz' => 2],
    ['foo' => 'one', 'bar' => 'C', 'baz' => 3],
    ['foo' => 'two', 'bar' => 'A', 'baz' => 4],
    ['foo' => 'two', 'bar' => 'B', 'baz' => 5],
    ['foo' => 'two', 'bar' => 'C', 'baz' => 6],
];
```

### "Group" operation

[](#group-operation)

```
// examples/group.php:
require_once '../vendor/autoload.php';

use Weby\Sloth\Sloth;

include_once 'data.php';

Sloth::from($data)
    ->group('foo', 'baz')
    ->count()
    ->sum()
    ->avg()
    ->print();

// Outputs:
// foo      count   sum      avg
// one      3       6        2
// two      3       15       5
```

### "Pivot" operation

[](#pivot-operation)

```
// examples/pivot.php:
require_once '../vendor/autoload.php';

use Weby\Sloth\Sloth;

include_once 'data.php';

Sloth::from($data)
    ->pivot('foo', 'bar', 'baz')
    ->print();

// Outputs:
// foo     A       B       C
// one     1       2       3
// two     4       5       6
```

Tests
-----

[](#tests)

Running the tests is simple:

```
vendor/bin/phpunit
```

Documentation
-------------

[](#documentation)

The documentation is located in this repo's [wiki](https://github.com/maximiliamus/weby-sloth/wiki/Documentation).

License
-------

[](#license)

Weby\\Sloth is distributed under the MIT license.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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

Every ~790 days

Total

2

Last Release

2061d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d025a28871fe21ea42c16cd21230a22b89fa5fe166acbd40d8ceb1453f82409?d=identicon)[maximiliamus](/maintainers/maximiliamus)

---

Top Contributors

[![maximiliamus](https://avatars.githubusercontent.com/u/35597632?v=4)](https://github.com/maximiliamus "maximiliamus (84 commits)")

---

Tags

data-analysisdata-manipulatongroup-byphp-librarypivot-tablereportingphpreportingdata-analysisdata-manipulationgroup arraypivot array

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/weby-sloth/health.svg)

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)[andreas-glaser/php-helpers

A comprehensive collection of PHP utility functions for array manipulation, string operations, date handling, HTML generation, form building, validation, and more. Modern PHP 8.2+ library with full type safety.

1386.5k2](/packages/andreas-glaser-php-helpers)

PHPackages © 2026

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