https://github.com/mitchpaulus/uc
Unit conversions from the shell!
https://github.com/mitchpaulus/uc
engineering haskell shell unit-conversions
Last synced: about 1 month ago
JSON representation
Unit conversions from the shell!
- Host: GitHub
- URL: https://github.com/mitchpaulus/uc
- Owner: mitchpaulus
- License: bsd-3-clause
- Created: 2019-11-23T14:56:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-21T15:59:02.000Z (about 5 years ago)
- Last Synced: 2025-07-06T22:17:42.745Z (7 months ago)
- Topics: engineering, haskell, shell, unit-conversions
- Language: Haskell
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# `uc` - Unit Conversions from the Shell!
`uc` is a fun little utility that lets you do a quick unit conversion
on the fly. As an engineer, I find this quite useful to have at my
fingertips in the terminal. (Note: this was a small project to try out Haskell - in
reality I typically use the [GNU `units`](https://www.gnu.org/software/units/) utility, which is
far more expansive and battle tested than this).
The basic usage is:
`uc value fromUnit toUnit`
and it works like:
```
$ uc 10 m2 ft2
107.63910416709722
```
## Tab Completion
Tab completion for the units is available in bash. You just need to
source the line
```sh
eval "$(uc -c)"
```
somewhere in your `.bashrc` file.
## Available Units
Argument | Unit Name
------|-------
`F` | Fahrenheit
`C` | Celsius
`K` | Kelvin
`R` | Rankine
`m2` | Square meters
`ft2` | Square feet
`in2` | Square inches
`km2` | Square kilometers
`m` | Meters
`ft` | Feet
`kBtu` | Thousand BTU
`MMBtu` | Million BTU
`kWh` | Kilowatt hour
`MWh` | Megawatt hour
`GJ` | Gigajoules
`ng_ccf` | Hundred cubic feet natural gas
`ng_kcf` | Thousand cubic feet natural gas
`ng_mcf` | Million cubic feet natural gas
`ng_m3` | Cubic meters natural gas
`Therms` | Therms
`steam_lb` | lbs of steam
`steam_klb` | Thousand lbs of steam
`steam_Mlb` | Million lbs of steam
`steam_kg` | kg of steam
`ton-hrs` | Ton hours
`m3/s` | Cubic meters per second
`gpm` | Gallons per minute
`cfm` | Cubic feet per minute
`W` | Watt
`kw` | Kilowatt
`MW` | Megawatt
`Btu/h` | BTU per hour
`kBtu/h` | Thousand BTU per hour
`ton` | Tons
`hp` | Horsepower
`kJ/kg` | Kilojoules per Kilogram
`Btu/lbm` | BTU per pound mass