Skip to main content

Powerful yet easy command line calculator.

Project description

cli-calc

test codecov Python Version wemake-python-styleguide

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))

Libraries

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 is evil.

However some precautions are taken.

Development tools used

Features

Tools

Style and type annotations

Testing and CT

Build and publish to pypi

Development Environment

Documentation

License

MIT

Credits

This project was generated with wemake-python-package. Current template version is: d06993f12e3ffad79652a2aec86189dee92d94dd. See what is updated since then.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli-calc-0.2.4.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

cli_calc-0.2.4-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file cli-calc-0.2.4.tar.gz.

File metadata

  • Download URL: cli-calc-0.2.4.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.5 Darwin/18.6.0

File hashes

Hashes for cli-calc-0.2.4.tar.gz
Algorithm Hash digest
SHA256 f2a95f700e4c51b66c75b17946ff69124e554ef5dffe59623ba4153a20c613d0
MD5 2d6cdedc71e705d969a1085ecb17b955
BLAKE2b-256 d972d2da228072c61299f97a60a4e9f3445d4ff0810e7c37599fbe5a7a7bdeb2

See more details on using hashes here.

File details

Details for the file cli_calc-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: cli_calc-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.5 Darwin/18.6.0

File hashes

Hashes for cli_calc-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c768846afc2ab3abe12b05c6842bd681cc66e72a9f1d030ebef4a0f1f624d697
MD5 4e55c2bd6ff672865b01cd8b6d70fbce
BLAKE2b-256 45ec607bd558cfdaefc0076a5a837f49a7474ed817d66a9a30de30d172199439

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page