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

Development

Pull Request

Are Welcome! However howto is still missing here. See Issue #13

Metric Dashboard

test codecov SLOC SLOC Tests SLOC Dev

Python Version Python Lang Languages wemake-python-styleguide

Scrutinizer Code Quality CodeQL Requirements Status Dependencies

pypi github release pypi downloads

last commit github commits code size github downloads github stars

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

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
  • git distributed version control system
  • github online collaborative version control
  • Markdown lightweight markup language
  • vi advanced text editor
  • VS Code source-code editor

Documentation

  • sphinx Python documentation Generator
  • doc8 opinionated style checker for rst

Metric

Jason Query for Makefile and Shields

Python development course, based around this code

All this will move into a sister project to actually teach this approach. See Add Teaching repository.

Learn Python

OOO

Code Smells

Refactoring

SOLID

Design Patterns

Class

Manifests

Following these rules, which basically reduce our possibilities, we enable ourselves to write maintainable software. They build upon each other.

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.14.tar.gz (18.1 kB view hashes)

Uploaded Source

Built Distribution

cli_calc-0.2.14-py3-none-any.whl (16.5 kB view hashes)

Uploaded Python 3

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