#measure #unit #parser

ucum

Implementation of the Unified Code for Units of Measures (UCUM)

1 unstable release

0.1.0 Aug 10, 2020

#847 in Science

Download history 58/week @ 2023-11-20 23/week @ 2023-11-27 22/week @ 2023-12-04 111/week @ 2023-12-11 100/week @ 2023-12-18 72/week @ 2024-01-01 97/week @ 2024-01-08 117/week @ 2024-01-15 229/week @ 2024-01-22 53/week @ 2024-01-29 182/week @ 2024-02-05 166/week @ 2024-02-12 56/week @ 2024-02-19 23/week @ 2024-02-26 53/week @ 2024-03-04

298 downloads per month

CECILL-B

97KB
2.5K SLoC

Rust implementation of UCUM

UCUM is the Unified Code for Units of Measure.

This crate is a partial implementation of the UCUM specification.

See crate documentation for more detail.


lib.rs:

UCUM is the Unified Code for Units of Measure.

This crate is a (partial) implementation of the revision 442 of the UCUM specification.

Quick start

use ucum::prelude::*;

let system = UnitSystem::<f64>::default();
let q1 = system.parse("35.5 km/h")?;
let q2 = system.parse("1.1e1 m.s-1")?;
assert!(q1 < q2);
assert!(2*q1 > q2);

Implementation status

Syntax and semantics

Unit tables

Misc

  • Full crate documentation

No runtime deps