PHPackages                             bright-webb/cobra - 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. bright-webb/cobra

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

bright-webb/cobra
=================

PHP library for managing and manipulating data

v1.1.6(1y ago)5113PHP

Since Jun 14Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (12)Used By (0)

Cobra
=====

[](#cobra)

Cobra is a data management for PHP to clean, modify and transform your data. Whether you're working with data from a database, CSV files, or arrays, Cobra provides a suite of tools to help you handle, transform, and analyze your data efficiently.

Features
--------

[](#features)

- Load data from SQL databases and CSV files
- Transform and manipulate data using various methods
- Generate, display, and export data
- Handle missing data and perform statistical operations
- Merge, join, and concatenate data frames

Using cobra
-----------

[](#using-cobra)

Cobra has 3 class, **DataFrame**, **DB** and **Series**You can use the DB class to perform basic SQL operations such as select and query

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

[](#installation)

`composer require bright-webb/cobra`

Usage
-----

[](#usage)

If you want to use cobra with your database, you must create a .env file, to create and use .env, you need to install `vlucas/phpdotenv` package configure your environment as follows

- DB\_USERNAME
- DB\_PASSWORD
- DB\_HOST
- DB\_DATABASE

and that's it, cobra will be able to connect to your database, if you're using Laravel, even better.

```
use Cobra\DataFrame;

```

Create a new DataFrame Object

```
$df = new DataFrame();

```

You can load your data in 3 ways, from your database, csv or json. To load from your database, you use the table method

```
$df->table('table_name');
// from csv
$df->fromCsv('path');

```

Data Analysis
-------------

[](#data-analysis)

```
print_r($df->describe())
print($df->mean())
print($df->median())
print($df->average())
print($df->sum('column_name'))
print_r($df->groupBy('column_name'))

```

Data Manipulation
-----------------

[](#data-manipulation)

```
$df->head(); // You can also pass the number of rows as argument
print_r($df->toArray());

```

Can also be printed as html table

```
print($df->toTable());

```

Drop all null or blank columns

```
$df->dropna();
$df->fillna(); // You can also pass the the value to fill as argument
$df->dropColumn('column_name')

```

Contributing
------------

[](#contributing)

Contributions are welcome! Please open an issue or submit a pull request.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Recently: every ~9 days

Total

11

Last Release

657d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5958d0c8d4903a43f50c3b1b0d3ce01fe71652ba5af72c20b4902afb870fc26?d=identicon)[bright-webb](/maintainers/bright-webb)

---

Top Contributors

[![bright-webb](https://avatars.githubusercontent.com/u/60761289?v=4)](https://github.com/bright-webb "bright-webb (14 commits)")

### Embed Badge

![Health badge](/badges/bright-webb-cobra/health.svg)

```
[![Health](https://phpackages.com/badges/bright-webb-cobra/health.svg)](https://phpackages.com/packages/bright-webb-cobra)
```

###  Alternatives

[fbf/laravel-youtube

A Laravel package to upload videos to a YouTube channel

954.2k](/packages/fbf-laravel-youtube)[quadrubo/filament-model-settings

This is my package filament-model-settings

1637.5k](/packages/quadrubo-filament-model-settings)[typicms/bootforms

Just a Formbuilder with some Bootstrap 5 specific conveniences. Remembers old input, retrieves error messages and handles all your boilerplate Bootstrap markup automatically.

1256.0k2](/packages/typicms-bootforms)[zmoyi/jstan

聚水潭-php-sdk

153.8k1](/packages/zmoyi-jstan)

PHPackages © 2026

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