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

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

soandso/units
=============

Meteorological unit converter

0.0.1(today)01↑2900%GPL-2.0-or-laterPHPPHP &gt;=8.4

Since Jun 22Pushed todayCompare

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

READMEChangelog (2)Dependencies (3)Versions (1)Used By (0)

Units
=====

[](#units)

PHP library for meteorological unit conversion.

Features
--------

[](#features)

- Temperature conversion
- Wind speed conversion
- Atmospheric pressure conversion
- Precipitation conversion
- Distance conversion
- Support for strongly typed enums
- Fluent API
- Unit metadata registry
- Framework independent
- PHP 8.4+

---

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

[](#installation)

Install via Composer:

```
composer require soandso/units
```

---

Quick Start
-----------

[](#quick-start)

```
require __DIR__ . '/vendor/autoload.php';

use Soandso\Units\Bootstrap;

Bootstrap::init();
```

---

Supported Quantities
--------------------

[](#supported-quantities)

Retrieve metadata for a quantity:

```
use Soandso\Units\Registry\Quantity;
use Soandso\Units\Unit;

$temperature = Quantity::get(Unit::TEMPERATURE);

$temperature->name;
$temperature->description;
$temperature->class;

$temperature->units;
```

Example output:

```
Temperature
Air temperature units
Soandso\Units\Value\Temperature

[
    "C",
    "F",
    "K"
]

```

---

Temperature Conversion
----------------------

[](#temperature-conversion)

### Fluent API

[](#fluent-api)

```
use Soandso\Units\Value\Temperature;

Temperature::c(20)
    ->toF()
    ->value(); //68
```

### Generic Conversion

[](#generic-conversion)

```
use Soandso\Units\Value\Temperature;
use Soandso\Units\Enum\Temperature as TemperatureUnit;

Temperature::c(20)
    ->convertTo(TemperatureUnit::F)
    ->value(); //68
```

---

Creating Values
---------------

[](#creating-values)

Values can be created using named constructors:

```
Temperature::c(20);
Temperature::f(68);
Temperature::k(293.15);
```

---

Working with Value Objects
--------------------------

[](#working-with-value-objects)

```
$temperature = Temperature::c(20);

$temperature->value();
$temperature->unit()->value;
```

---

Available Quantities
--------------------

[](#available-quantities)

Depending on installed version, the library may support:

- Temperature
- Pressure
- Wind Speed
- Precipitation
- Distance
- Visibility
- Humidity
- Cloud Base Height

Example:

```
use Soandso\Units\Enum\Unit;
use Soandso\Units\Registry\Quantity;

$quantity = Quantity::get(Unit::PRESSURE);
```

---

Registry
--------

[](#registry)

The registry provides metadata about all supported quantities.

```
use Soandso\Units\Registry\Quantity;

$all = Quantity::all();
```

---

Example
-------

[](#example)

```
use Soandso\Units\Value\Temperature;

$celsius = Temperature::c(20);

$celsius->toF()->value(); //68
$celsius->toK()->value(); //293.15
```

---

Requirements
------------

[](#requirements)

- PHP 8.4+
- Composer

---

License
-------

[](#license)

Grouping is licensed under the GPLv2 License ().

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/585980?v=4)[soandso](/maintainers/soandso)[@soandso](https://github.com/soandso)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[olegkoval/php-user-info

Get information about user which visited page of your website

291.8k](/packages/olegkoval-php-user-info)

PHPackages © 2026

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