https://github.com/tecnickcom/unitmulti
Convert base unit values to multiples and submultiples
https://github.com/tecnickcom/unitmulti
Last synced: 8 months ago
JSON representation
Convert base unit values to multiples and submultiples
- Host: GitHub
- URL: https://github.com/tecnickcom/unitmulti
- Owner: tecnickcom
- License: other
- Created: 2019-02-05T18:14:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-01T10:30:55.000Z (over 5 years ago)
- Last Synced: 2025-01-07T09:46:10.531Z (9 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# unitmulti
*Convert base unit values to multiples and submultiples*
[](https://travis-ci.org/tecnickcom/unitmulti?branch=master)
[](https://coveralls.io/github/tecnickcom/unitmulti?branch=master)* **category** Library
* **copyright** 2019 Tecnick.com LTD
* **license** see [LICENSE](LICENSE)
* **link** https://github.com/tecnickcom/unitmulti## Description
Convert base unit values to multiples and submultiples.
For example:
```
12345 B -> 12.1 KiB
1000 m -> 1.0 Km
```## Quick Start
This project includes a Makefile that allows you to test and build the project in a Linux-compatible system with simple commands.
To see all available options:
```
make help
```To test the project inside a Python 2.7 virtual environment:
```
make vtest
```To build a Conda development environment:
```
make conda_dev
. activate
```To test inside a `conda_dev` environment using setuptools:
```
make test
```To build and test the project inside a Conda environment:
```
make build
```The coverage report is available at:
```env-unitmulti/conda-bld/coverage/htmlcov/index.html```To build the project inside a Docker container (requires Docker):
```
make dbuild
```An arbitrary make target can be executed inside a Docker container by specifying the "MAKETARGET" parameter:
```
MAKETARGET='build' make dbuild
```
The list of make targets can be obtained by typing ```make```The base Docker building environment is defined in the following Dockerfile:
```
resources/Docker/Dockerfile.dev
```To format the code (please use this command before submitting any pull request):
```
make format
```## Useful Docker commands
To manually create the container you can execute:
```
docker build --tag="tecnickcom/unitmultidev" .
```To log into the newly created container:
```
docker run -t -i tecnickcom/unitmultidev /bin/bash
```To get the container ID:
```
CONTAINER_ID=`docker ps -a | grep tecnickcom/unitmultidev | cut -c1-12`
```To delete the newly created docker container:
```
docker rm -f $CONTAINER_ID
```To delete the docker image:
```
docker rmi -f tecnickcom/unitmultidev
```To delete all containers
```
docker rm $(docker ps -a -q)
```To delete all images
```
docker rmi $(docker images -q)
```