PHPackages                             amneale/byteform - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. amneale/byteform

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

amneale/byteform
================

PHP library for parsing byte amounts

v1.2.0(3y ago)127PHPPHP ^7.4|^8.0CI passing

Since Mar 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/amneale/byteform)[ Packagist](https://packagist.org/packages/amneale/byteform)[ RSS](/packages/amneale-byteform/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Byteform [![tests](https://github.com/amneale/byteform/workflows/tests/badge.svg)](https://github.com/amneale/byteform/workflows/tests/badge.svg)
=================================================================================================================================================

[](#byteform-)

PHP library for parsing and formatting byte amounts

Installing
----------

[](#installing)

```
composer require amneale/byteform
```

Usage
-----

[](#usage)

### Parsing byte amounts

[](#parsing-byte-amounts)

```
$parser = new \Amneale\ByteForm\ByteParser();
$parser->parseBytes("1.5KB"); // int(1536)
```

### Formatting byte amounts

[](#formatting-byte-amounts)

```
$formatter = new \Amneale\ByteForm\ByteFormatter();
$formatter->formatBytes(1536); // "1.50KB"
$formatter->formatBytes(1536, 1); // "1.5KB"
```

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

[](#contributing)

### Running tests

[](#running-tests)

byteform uses [phpspec](http://www.phpspec.net) to drive development

```
make test
```

### Fixing code style

[](#fixing-code-style)

Code style rules are defined in `.php_cs.dist`. These rules are used to automatically fix any code style discrepancies

```
make fmt
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Total

3

Last Release

1446d ago

PHP version history (2 changes)v1.0.0PHP ^7.4

v1.2.0PHP ^7.4|^8.0

### Community

Maintainers

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

---

Top Contributors

[![amneale](https://avatars.githubusercontent.com/u/10009435?v=4)](https://github.com/amneale "amneale (12 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/amneale-byteform/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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