convers

Crates.ioconvers
lib.rsconvers
version0.2.1
sourcesrc
created_at2024-11-01 08:55:21.325651
updated_at2024-11-08 18:18:58.378558
descriptionCool convert library that converts almost everything(not yet).Units,Languages,Calculations,etc.
homepage
repositoryhttps://github.com/veaquer/convers
max_upload_size
id1431566
size31,576
Veaquer (veaquer)

documentation

https://docs.rs/convers

README

convers

convers - is a cool library for converting data from one format to another. The idea is to convert everything from one query, like from one language, unit, etc., to another. There are functions that allow you to do something like that.

Example of usage magic_convert function:

use convers::convert::magic_convert;
#[tokio::main]
async fn main() {
    let query = "1m to cm".to_string();
    let result = magic_convert(&query).await.unwrap(); // Is String - "100 Centimeters"
    let translate_result = magic_convert(&String::from("en:de how are u?")).await.unwrap(); // Is String - "wie geht es dir?" or something like that
    let calculated = magic_convert(&String::from("15/3")).await.unwrap(); // Is String - "5" or "5.0"
}

What's new in release ?

  • Translate bug fix ('to' and ':' issue)
  • Convert currencies(available in magic_convert)

Also you can use provided things directly:

  • Translator struct
  • Measurement struct
  • Evaluate fn

Example of usage Measurement:

use convers::utils::units::{Measurement, Unit};
let a = Measurement::new(50.0, Unit::Meter);
let b = Measurement::new(1.0, Unit::Kilometer);
let c = a + b; // anyhow::Result<Measurement>. If unwrap it equals 1.050 Kilometer

Current available conversions:

  • Units: Length, Mass, Amperes, Watts, Size (like kb), Rem/Px/Em,Temperature, Pressure, Speed, Volume, Area
  • Translate
  • Translate
  • Currencies
  • Evaluate (with Units too)

User Interfaces for convers:

  • convers_prompt - An attempt to create something comfy like Raycast. (Soon it will be better)

Soon will be added:

  • Conversion of timezones
  • CLI convers binary package to crates.io and AUR
Commit count: 25

cargo fmt