Skip to content
/ resf Public

A simple package for displaying calculation results in a textbased table

License

Notifications You must be signed in to change notification settings

rol1510/resf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

resf - Result Formatter

A simple package for displaying calculation results in a textbased table

Install

pip install resf

pypi page


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

About

A simple package for displaying calculation results in a textbased table

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published