PHPackages                             soandso/grouping - 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. soandso/grouping

ActiveLiblary

soandso/grouping
================

Statistical grouping

0.1.3(6y ago)012GPL-2.0-or-laterPHPPHP ^7.0CI failing

Since Dec 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/soandsoSwEn/Grouping)[ Packagist](https://packagist.org/packages/soandso/grouping)[ RSS](/packages/soandso-grouping/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Grouping - PHP library for generating grouped statistical series
================================================================

[](#grouping---php-library-for-generating-grouped-statistical-series)

The library allows you to create grouped out of simple statistical series, subject to the use of large amounts of data.

Setup
-----

[](#setup)

Add the library to your `composer.json` file in your project:

```
{
  "require": {
      "soandso/grouping": "0.*"
  }
}
```

Use [composer](http://getcomposer.org) to install the library:

```
$ php composer.phar install
```

Composer will install Grouping inside your vendor folder. Then you can add the following to your .php files to use the library with Autoloading.

```
require_once(__DIR__ . '/vendor/autoload.php');
```

You can also use composer on the command line to require and install Grouping:

```
$ php composer.phar require soandso/grouping:0.*
```

Minimum Requirements
--------------------

[](#minimum-requirements)

- PHP 7

Description
-----------

[](#description)

To get started, you need to create an object of the core class of the library Grouping:

```
$object = new Grouping();
```

Next, you need to add the source data for the calculation:

```
$object->putSource($source_data);
```

$source\_data is the source data presented in the view of a simply non-associative array.

The peculiarity of the library is that you can pull out the method of adding source data many times.

```
$object->putSource($source_data1);
$object->putSource($source_data2);
$object->putSource($source_data3);

........
```

This may be important when dealing with large amounts of data. For example, you can upload a large file in parts Example,

```
function readFile($path) {
    $handle = fopen($path, "r");

    while(!feof($handle)) {
        yield $object->putSource(sourceToarray(trim(fgets($handle))));
    }

    fclose($handle);
}
```

After this construction of the grouped statistical series, you need to call the method buildGss:

```
$result = $object->buildGss($output, $path_file);
```

$output - parameter defining the format of the returned result. The parameter is required and can take such values ​​as 'array', 'json' and 'file'. $path\_file - parameter, defines the system path to the directory where the result file will be written. The parameter is optional. Must end with a slash '/'. Example:

```
/var/www/domain/folder/
```

As a result of constructing a guided statistical series, the library presents the following data: the number of partial intervals, the values ​​at the boundaries of the partial intervals, interval frequencies, random values ​​at the midpoints of partial intervals, interval frequencies. For example, the output in array format will look like:

```
[1]=>
  array(5) {
    ["left_border"]=>
    float(-9.4)
    ["right_border"]=>
    float(-7.85)
    ["middle_partial_interval"]=>
    float(-8.625)
    ["interval_frequency"]=>
    int(4)
    ["relative_frequency"]=>
    float(0.11428571428571)
  }
  [2]=>
  array(5) {
    ["left_border"]=>
    float(-7.85)
    ["right_border"]=>
    float(-6.3)
    ["middle_partial_interval"]=>
    float(-7.075)
    ["interval_frequency"]=>
    int(2)
    ["relative_frequency"]=>
    float(0.057142857142857)
  }
  [3]=>.....................

```

Standards
---------

[](#standards)

Grouping conforms to the following standards:

- PSR-1 - Basic coding standard ()
- PSR-4 - Autoloader ()
- PSR-12 - Extended coding style guide ()

License
-------

[](#license)

Grouping is licensed under the GPLv2 () License.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~10 days

Total

4

Last Release

2327d ago

### Community

Maintainers

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

---

Top Contributors

[![soandsoSwEn](https://avatars.githubusercontent.com/u/18630322?v=4)](https://github.com/soandsoSwEn "soandsoSwEn (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/soandso-grouping/health.svg)

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

PHPackages © 2026

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