
cli-calc¶
Powerful yet easy command line calculator.
Example Usage¶
cos(pi/2)
0xFF ^ 0b10
2**8-1
log(2)
comb(49,6)
factorial(42)
random()
cmath.phase(complex(-1.0, 0.0))
All function of the following Math Libraries are ready to use out of the box¶
standard operators
-, >>, ...
standard math library
cd, log, sin, sinh, gamma, pi, e, tau, inf, nan...
cmath
phase(complex(-1.0, 0.0)), and then most of the above with complex numbers.
random
random, choice(['win', 'lose', 'draw']), mean, ...
built in functions
max, help, sum, ...
Installation¶
pip install cli-calc
Configuration¶
In order to run it from anywhere: Add a symbolic link in ~/bin
cd ~/bin
ln -s ~/path/to/your/install/cli_calc/warpper.sh calc
Then use it anywhere. :-)
calc
echo "7+8" | calc
cat foo.bar | calc
Help¶
calc
h
Input:
"q" for quit, "h" for help
"_float_" and/or "_int_" for last value
"pi", "tau" and "e" for pi, tau and Euler
"+f" to add display for fraction, "-f" to suppress display for fraction
Other letters are:
he(x), (o)ctal, (b)inary, (i)nteger,
(f)raction, (t)ruth, i(e)ee, ieee_bi(n), f(r)om_ieee
"float" is always visible
See https://docs.python.org/3/library/math.html, use without "math."
https://www.w3schools.com/python/python_operators.asp
Try "cos(pi/2)", XOR: "0xFF ^ 0b10", "2**8-1", "factorial(42)",
"help(math)"
Warning¶
Use of ``eval` <https://docs.python.org/3/library/functions.html#eval>`_ is evil. However some precautions are taken.
Development¶
Pull Request¶
PR’s are Welcome! However the PR Howto is still missing here. See Issue #13
Metric Dashboard¶

Note¶
flake8-commas one of the development plugins of the wemake-python-styleguide is marked as No Maintenance Intended. Hence the 1 deprecated dependency. See Issue.
This shields.io Shield sometimes has an issue 7022. Reason: It uses pypistats.org, which hits regularly a “429 RATE LIMIT EXCEEDED” error when accessing pypi.org/pypi/cli-calc/json. Therefore switched to the pepy.tech
However pypistats.org is better in filtering of automated downloads.
Features¶
Fully typed with annotations
Checked with mypy
Packaging PEP561 compatible
Tools¶
Python Packages¶
pypi.org Python Package Index
pythonrepo.com Popular Python Libraries
Style and type annotations¶
Testing¶
pytest test framework
The Magic Tricks of Testing by Sandi Metz (Talk) on what to test, and what not
Continuous Testing & Integration (CT & CI)¶
Integration as in: Deployment and Integration testing.
-
pytest & coverage (yml) pytest @ python-version: [‘3.7’, ‘3.8’, ‘3.9’, ‘3.10’]
Alternatives to github actions
tox test and deploy
travis test and deploy
coveralls.io coverage
Build and publish to pypi¶
make Makefile automate above
poetry version bump bump version
poetry build wheel
poetry publish to pypi
Following Semantic Versioning¶
-
semver Python Package
Development Environment¶
poetry python packaging and dependency management
cookiecutter creates projects from project templates
venv creates projects from project templates
Version and Issue Management¶
IDE¶
Shell¶
Documentation¶
Markdown lightweight markup language
sphinx Python documentation Generator
doc8 opinionated style checker for rst
readthedocs document style and service
Metric¶
shields for Shields and Badges
issuehub.pro Label Guide
cloc for SLOC
Jason Query for Makefile and Shields¶
Teaching Python Development¶
cli-calc Examples¶
NvK Tools¶
License¶
Credits¶
This project was generated with ``wemake-python-package` <https://github.com/wemake-services/wemake-python-package>`_. Current template version is: d06993f12e3ffad79652a2aec86189dee92d94dd. See what is updated since then.
Contents¶
Changelog