A simple package for displaying calculation results in a textbased table
Project description
resf - Result Formatter
A simple package for displaying calculation results in a textbased table
Install
pip install resf
How to use
Basics
from resf import *
initRes() # Initializes new Table
addRes('Name', value) # Add a value to the table
addRes('Name', value, 'Unit', precision) # Unit and Precision can be set
printRes() # prints the resulting table
Sample 1
foo = 15
bar = 123 / 14
initRes()
addRes('Foo', foo, 'kg')
addEmpty() # Add an empty line
addRes('0 digits of Bar', bar, precision=0)
addRes('4 digits of Bar', bar, precision=4)
printRes()
Output 1
+-----------------+----------------+
| Name | Value [Unit] |
|-----------------+----------------|
| Foo | 15.00 kg |
| | |
| 0 digits of Bar | 9 |
| 4 digits of Bar | 8.7857 |
+-----------------+----------------+
All Functions
initRes()
addRes(name, value, unit='', precision=2)
addEmpty()
printRes()
Uses tabulate to generate the table
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
resf-0.1.4-py3-none-any.whl
(3.2 kB
view details)
File details
Details for the file resf-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: resf-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7abbc087569a98d4ef3ce5643138a4ee7442152b4548591badb2763e0ba92263 |
|
MD5 | d6f946507524b13b87c5156954c14c84 |
|
BLAKE2b-256 | b4820dd18810c99e45cad1fbe7e2dddb5fa642ca47147839ab872379f3519b31 |