Skip to content

Commit

Permalink
Update readme for PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
dalito committed Jan 16, 2024
1 parent fb86a2f commit da314fa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![](https://github.com/dalito/ucumvert/workflows/CI/badge.svg)](https://github.com/dalito/ucumvert/actions)
[![PyPI - Version](https://img.shields.io/pypi/v/ucumvert)](https://pypi.org/project/ucumvert)

# Easier access to UCUM from Python

> **Feedback welcome!**
Expand Down Expand Up @@ -25,7 +28,13 @@ For all of them we define mappings to valid pint unit names in [ucum_pint.py](ht

## Install

Installation from git in developer mode including creation of a virtual environment (pip should be newer than 23.1):
ucumvert is available as Python package from [PyPi](https://pypi.org/project/ucumvert) and can be pip-installed in the usual way.

```bash
pip install ucumvert
```

To install the most recent code from git in developer mode including creation of a virtual environment (pip should be newer than 23.1) use:

Linux

Expand Down Expand Up @@ -82,7 +91,7 @@ main_term

So the intermediate result is a tree which is then traversed to convert the elements to pint quantities (or pint-compatible strings):

![parse tree](parse_tree.png)
![parse tree kg*m*s**-2](https://raw.githubusercontent.com/dalito/ucumvert/main/parse_tree.png)

The package includes an UCUM-aware pint UnitRegistry which loads all definitions for UCUM units on instantiation.
It comes with an additional method `from_ucum` to convert UCUM codes to pint.
Expand Down

0 comments on commit da314fa

Please sign in to comment.