convertx-0.1.0 is not a library.
Convertx
Unit Converter CLI
A simple Rust command-line tool for converting between a wide range of units in categories such as length, temperature, mass, data rate, area, volume, speed, pressure, bytes, time and more.
Installation
To install convertx you can do so via cargo
1. Install with Cargo:
Or simply put the following in your Cargo.toml.
[dependencies]
convertx = "0.1.0"
2. Clone and build:
Alternatively you can build it from the github repo and optionally install it globally
The binary will be located in target/release/convertx.
3. (Optional) Install globally:
Features
- Length: meters, kilometers, feet, inches
- Temperature: Celsius, Fahrenheit, Kelvin
- Mass/Weight: kilograms, pounds, ounces
- Data Rate: bits per second (bps), megabits per second (mbps)
- Bytes: supports human-readable and MB conversion
- Time: seconds, human-readable duration
- Area: square meters, square feet, acres, hectares
- Volume: liters, milliliters, cubic meters, cubic inches, gallons
- Speed: meters per second, kilometers per hour, miles per hour, knots
- Pressure: pascal, bar, atm, psi
- Easy to extend: add your own units and categories with minimal code changes
- Helpful CLI: shows usage and supported units on
--help
Usage
Get help for any subcommand:
Supported Subcommands
| Subcommand | Description | Example |
|---|---|---|
| bytes | Convert byte values | convertx bytes 1048576 --megabytes |
| time | Convert seconds to human time | convertx time 4000 --human-readable |
| length | Convert length units | convertx length 2 --from meters --to feet |
| temperature | Convert temperature units | convertx temperature 100 --from c --to f |
| mass | Convert mass/weight units | convertx mass 2.5 --from kg --to lb |
| datarate | Convert data rate units | convertx datarate 10 --from mbps --to bps |
| area | Convert area units | convertx area 1000 --from sqm --to acres |
| volume | Convert volume units | convertx volume 2 --from gallons --to liters |
| speed | Convert speed units | convertx speed 60 --from mph --to kph |
| pressure | Convert pressure units | convertx pressure 1 --from atm --to psi |
Examples
Bytes:
Time:
Length:
Temperature:
Mass:
Data Rate:
Area:
Volume:
Speed:
Pressure:
Extending & Contributing
- Add new units by adding an enum variant, conversion function, and CLI case!
- PRs and improvements very welcome.
Jesus Saves @JCharisTech
Enjoy lightning-fast, accurate unit conversions from your terminal!