Metadata-Version: 2.4
Name: allunitconvert
Version: 1.0.0
Summary: A lightweight Python unit conversion library with SI support.
Author: WaAaA
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# AllUnitConvert

AllUnitConvert (AUC) is a lightweight Python library for common unit conversions, including SI units.

## Installation

```bash
python -m pip install allunitconvert
```

## Quick start

```python
import allunitconvert as auc

print(auc.convert(5, "km", "m"))       # 5000.0
print(auc.convert(25, "C", "F"))       # 77.0
print(auc.convert(1, "kg", "g"))       # 1000.0
print(auc.convert(1, "GB", "MB"))      # 1000.0
```

## Supported dimensions

- Length: mm, cm, m, km, in, ft, yd, mi
- Mass: mg, g, kg, tonne, lb, oz
- Time: ms, s, min, h, day
- Temperature: C, F, K
- Area: mm2, cm2, m2, km2, ha, acre
- Volume: mL, L, m3, cm3, US gal
- Speed: m/s, km/h, mph
- Pressure: Pa, kPa, MPa, bar, atm, psi
- Energy: J, kJ, cal, kcal, Wh, kWh
- Power: W, kW, MW, hp
- Frequency: Hz, kHz, MHz, GHz
- Force: N, kN, lbf
- Electric current: A, mA, kA
- Voltage: V, mV, kV
- Digital storage: B, kB, MB, GB, TB (decimal SI); KiB, MiB, GiB, TiB (binary)

SI decimal prefixes use powers of 1000. Binary data units use powers of 1024.

## Generic conversion

```python
auc.convert(100, "cm", "m")
auc.convert(36, "km/h", "m/s")
auc.convert(0, "C", "K")
```

Unknown units and incompatible dimensions raise `ValueError`.

## Legacy functions

The functions from version 0.1.0 remain available:

```python
auc.km_to_m(5)
auc.m_to_km(1000)
auc.cm_to_m(100)
auc.kg_to_g(2)
auc.g_to_kg(1000)
auc.c_to_f(25)
auc.f_to_c(77)
auc.gb_to_bytes(1)
auc.gb_to_mb(1)
auc.mb_to_gb(1024)
auc.sec_to_min(60)
auc.min_to_hour(120)
auc.kmh_to_ms(36)
auc.ms_to_kmh(10)
```

Legacy `gb_to_mb` and `mb_to_gb` use the historical 1024-based convention for compatibility. Use `convert()` for decimal SI units or `GiB`/`MiB` for binary units.

## Command line

```bash
auc --help
auc --version
auc 5 km m
auc 25 C F
auc --list-units
```

## PyPI

https://pypi.org/project/allunitconvert/

## License

MIT
