Calculator App is a Python-powered terminal calculator that goes far beyond basic arithmetic. Installed as a single pip package and launched with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Seaus-tech/Calculator-App/llms.txt
Use this file to discover all available pages before exploring further.
calc-app command, it gives you an interactive REPL where you can crunch numbers using plain English, work with fractions, solve linear equations, store named variables, call math functions, and even toggle a meme mode for comic relief — all without leaving your terminal.
Features at a Glance
Calculator App ships with a broad set of capabilities out of the box:- Basic arithmetic — addition, subtraction, multiplication, division, and exponentiation with correct operator precedence
- Natural language input — phrases like
9 squared,5 cubed, andsqrt of 16are parsed and evaluated automatically - Fraction arithmetic — enter
1/2 + 1/3or mixed numbers like2 1/2 + 3/4and get exact fractional results - Equation solving — write
2x+4=10or6+x=7and the solver finds the unknown variable - Named variables — set
x=5and then reusexin any subsequent expression - Math functions —
sqrt,sin,cos,tan,log, and constantspiandeare available by default - Meme mode — type
memeto toggle on a layer of internet humour over your results
Explore the Features
Basic Math
Arithmetic expressions with full operator precedence and exponentiation.
Fractions
Exact fraction and mixed-number arithmetic powered by Python’s
Fraction type.Natural Language
Type expressions in plain English: squared, cubed, sqrt of, and more.
Variables
Store values with
x=5 and reference them in any later expression.Equation Solver
Solve linear equations like
2x+4=10 directly at the prompt.Math Functions
Built-in access to
sqrt, sin, cos, tan, log, pi, and e.Meme Mode
Toggle meme mode with
meme for humorous takes on your calculations.How It Works
Calculator App runs as a REPL (Read-Eval-Print Loop). Each time you press Enter, the app reads your input line and routes it through a processing pipeline:- Natural language parser (
parser.py) — rewrites English phrases into Python-compatible expressions (e.g.9 squared→(9)**2). - Fraction parser (
fractions.py) — converts fraction literals and mixed numbers intoFraction(...)constructor calls so arithmetic stays exact. - Evaluator (
evaluator.py) — substitutes any stored variable names with their current values, then calls Python’sevalagainst a tightly controlled safe namespace that exposes only the math functions listed above, preventing arbitrary code execution. - Equation solver (
solver.py) — when the input contains both=and a letter, the solver isolates the unknown and returns its value instead of routing through the evaluator. - Meme handler (
meme.py) — when meme mode is active, a small set of well-known inputs are intercepted and returned with comedic results before the evaluator runs.
quit or press Ctrl+C.
Calculator App requires Python 3.10 or later. Make sure your environment meets this requirement before installing. You can check your version with
python --version.