### Install ucumvert in developer mode (Windows) Source: https://github.com/dalito/ucumvert/blob/main/README.md Clone the repository and install the package in editable mode with development dependencies on Windows. This setup is for developers working on the ucumvert project. ```bash git clone https://github.com/dalito/ucumvert.git cd ucumvert py -m venv .venv .venv\Scripts\activate.bat py -m pip install --upgrade pip pip install -e .[dev] ``` -------------------------------- ### Install ucumvert package Source: https://github.com/dalito/ucumvert/blob/main/README.md Install the ucumvert package using pip. This is the standard method for adding the library to your Python environment. ```bash pip install ucumvert ``` -------------------------------- ### Install ucumvert in developer mode (Linux) Source: https://github.com/dalito/ucumvert/blob/main/README.md Clone the repository and install the package in editable mode with development dependencies. This is useful for contributing to the project or making modifications. ```bash git clone https://github.com/dalito/ucumvert.git cd ucumvert python -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip pip install -e .[dev] ``` -------------------------------- ### Generate TSV from UCUM XLSX file Source: https://github.com/dalito/ucumvert/blob/main/README.md Re-generate the `ucum_examples.tsv` file from the official UCUM XLSX file. This requires the `openpyxl` package and is useful for updating the example data. ```bash pip install openpyxl python src/ucumvert/vendor/get_ucum_example_as_tsv.py ``` -------------------------------- ### Interactive UCUM parsing and conversion Source: https://github.com/dalito/ucumvert/blob/main/README.md Use the command-line interface in interactive mode to parse UCUM codes and visualize their parse trees. The output shows the conversion to pint quantities. ```cmd (.venv) $ ucumvert -i Enter UCUM unit code to parse, or 'q' to quit. > m/s2.kg Created visualization of parse tree (parse_tree.png). main_term term term simple_unit m / annotatable simple_unit s 2 . simple_unit k g --> Pint > q ``` -------------------------------- ### Run the test suite Source: https://github.com/dalito/ucumvert/blob/main/README.md Execute the unit tests for the ucumvert package using pytest. This verifies the parsing and conversion functionality against common UCUM unit codes. ```bash pytest ``` -------------------------------- ### UCUM to pint conversion using PintUcumRegistry Source: https://github.com/dalito/ucumvert/blob/main/README.md Instantiate the PintUcumRegistry and use its `from_ucum` method to convert UCUM codes into pint quantities. This registry includes definitions for UCUM units. ```python from ucumvert import PintUcumRegistry ureg = PintUcumRegistry() ureg.from_ucum("m/s2.kg") # ureg.from_ucum("m[H2O]{35Cel}") # UCUM code with annotation # # ...to("mbar") # ureg("degC") # a standard pint unit # ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.