PHPackages                             lum/lum-units - 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. lum/lum-units

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

lum/lum-units
=============

Lum Units

v2.0.1(9mo ago)08MITPHP

Since Oct 8Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/supernovus/lum.units.php)[ Packagist](https://packagist.org/packages/lum/lum-units)[ RSS](/packages/lum-lum-units/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (8)Used By (0)

lum.units.php
=============

[](#lumunitsphp)

Summary
-------

[](#summary)

Classes representing different units of measurement, with the ability to convert between them.

The configuration file format is a bit weird, but it's that way for historical reasons. I'll probably make it support a nicer format at some point, while keeping a compatibility wrapper for the original version.

Classes
-------

[](#classes)

ClassDescriptionLum\\Units\\UnitsThe main Units library.Lum\\Units\\ExceptionSomething went wrong.Lum\\Units\\HasUnitsA trait for classes with units.Lum\\Units\\TypeClassA container representing a class of units.Lum\\Units\\ItemAn individual unit.Examples
--------

[](#examples)

See `examples` for a sample data file, and a script to convert between the units defined in it. You can only convert between units of the same type class. So for instance:

```
php example/convert.php 10 ha ac
# 24.710516301528

php example/convert.php 5 min sec
# 300

php example/convert.php 1.5 b mb
# 1572864

php example/convert.php 10 ha mb
# PHP Fatal error: Uncaught Lum\Units\Exception...

```

TODO
----

[](#todo)

- Write tests.
- Add new configuration format that is somewhat nicer.
- Add some kind of formatting feature using the 'sign'.

Official URLs
-------------

[](#official-urls)

This library can be found in two places:

- [Github](https://github.com/supernovus/lum.units.php)
- [Packageist](https://packagist.org/packages/lum/lum-units)

Author
------

[](#author)

Timothy Totten

License
-------

[](#license)

[MIT](https://spdx.org/licenses/MIT.html)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance58

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~337 days

Total

7

Last Release

270d ago

Major Versions

v1.x-dev → v2.0.02021-12-15

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

v1.0.1PHP ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ff04349507190155013e4a94a8b14860a7ac57afce4ba97961c7c79bd023dd7?d=identicon)[supernovus](/maintainers/supernovus)

### Embed Badge

![Health badge](/badges/lum-lum-units/health.svg)

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

###  Alternatives

[spiral/mcp-server

Spiral bridge for MCP server

541.1k2](/packages/spiral-mcp-server)

PHPackages © 2026

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