Skip to main content

Powerful yet easy command line calculator.

Project description

Logo

cli-calc

test codecov Python Version

pypi github release pypi downloads

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

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

Pull Request

PR's are Welcome! However the PR Howto is still missing here. See Issue #13

Metric Dashboard

test codecov pre-commit.ci status Documentation Status made-with-sphinx-doc

Scrutinizer Code Quality CodeQL Requirements Status Dependencies

Python Version Python Lang Languages wemake-python-styleguide

SLOC SLOC Tests SLOC Dev code size

Maintenance MIT pypi status github stars

pypi github release pypi wheel pypi d/l ( pypi downloads )

last commit commit since semver github commits since github commits rate

github issues next milestone github bugs open github bugs closed github issues open github issues closed github help open

Pull Requests open Pull Requests closed github downloads

Note

  1. Dependencies 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.

  2. pypi d/l 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. pypi downloads However pypistats.org is better in filtering of automated downloads. Will switch back, when stable again.

Features

Tools

Python Packages

Style and type annotations

  • pylint vim linter
  • isort sort imports
  • black opinionated code formatter
    • wemake strictest and most opinionated Python linter
  • mypy static type checker
  • flake8 Style Guide Enforcement
    • nitpick enforce the same settings across configuration files

Testing

Continuous Testing & Integration (CT & CI)

Integration as in: Deployment and Integration testing.

Build and publish to pypi

Following Semantic Versioning

Development Environment

  • poetry python packaging and dependency management
  • cookiecutter creates projects from project templates
  • venv creates projects from project templates

Version and Issue Management

  • git distributed version control system
  • github online collaborative version control
  • tickgit Not used, but collects TODO from source code

IDE

  • vi advanced text editor
  • VS Code source-code editor

Shell

Documentation

Metric

Jason Query for Makefile and Shields

Teaching Python Development

cli-calc Examples

NvK Tools

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.18.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

cli_calc-0.2.18-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cli-calc-0.2.18.tar.gz
  • Upload date:
  • Size: 18.8 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.18.tar.gz
Algorithm Hash digest
SHA256 fcf155dc79af5d32fd7c3d040d9b93f93293e35ca87b89d9ad4b9c961989bf1d
MD5 d9732a5fe5dad69b002ee12fec4ddc43
BLAKE2b-256 1da0fa4a8a28cfdc7a8ae5f486847e2a4a65ed73f37a4259e05aa1241cc74247

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cli_calc-0.2.18-py3-none-any.whl
  • Upload date:
  • Size: 16.8 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.18-py3-none-any.whl
Algorithm Hash digest
SHA256 be9457a25c09bb77c14b153d5c5706ad41e5c46a42aa28da1eb6fd27670d7294
MD5 90343ae26d3edf5c7e4e38a331a7c728
BLAKE2b-256 20b501a8d9d0374ba54dfd924f3a0e3553d5efe2556266899218c4ff048f25d1

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