A library to parse CMIXF-12.
To install from PyPi.
$ pip install cmixf
This will install a command line interface called cmixf
.
$ cmixf --help
Usage: cmixf [OPTIONS] [TEXT]...
Options:
-d, --debug Turn on token debugging
--help Show this message and exit.
At present this assumes that a number is provided before any unit. To better understand which characters are erroneous you can turn on the debug flag.
- Without debugging on:
$ cmixf
cmixf (Ctrl+d to quit) > 1mV
1mV
cmixf (Ctrl+d to quit) > 1oC
1oC
cmixf (Ctrl+d to quit) > 1mM
FAILED: Line 1: Bad character 'M'
cmixf (Ctrl+d to quit) >
- With debugging turned on:
$ cmixf --debug
cmixf (Ctrl+d to quit) > 1mM
type='REAL', value='1'
type='UNITC', value='m'
FAILED: Line 1: Bad character 'M'
cmixf (Ctrl+d to quit) >
After cloning the repo do:
- pip install -e .[dev]
- pre-commit install