Skip to main content

A simple, elegant terminal calculator with interactive mode

Project description

calcli

A simple, elegant terminal calculator with interactive mode. Perfect for quick math without leaving your terminal.

Quick Start

pip install calcli
calcli

Done. You're in calculator mode.

Usage

Interactive Mode

calcli

Then:

calcli> 5 + 3
8
calcli> 10 * 2.5
25
calcli> 32% of 2345454
750545.28
calcli> 5 km to miles
3.11 miles
calcli> h
calcli> exit

Single Calculation

calcli "5 + 3"
# Output: 8

calcli "32% of 100"
# Output: 32

calcli "10 km to miles"
# Output: 6.21 miles

Features

Interactive mode — Stay in the calculator, run multiple calculations
Basic math — Add, subtract, multiply, divide, parentheses
Percentages — "32% of 2345454" syntax
Unit conversions — 14+ conversions including distance, weight, temperature, volume
Colored output — Clean, readable results
Fast — No GUI overhead, pure terminal speed
History — Type h to see your last 10 calculations with results
Auto-copy — Results are instantly copied to your clipboard

Available Conversions

celsius to fahrenheit      kg to lbs                 miles to km
fahrenheit to celsius      km to miles               ounces to grams
feet to meters             lbs to kg                 grams to ounces
meters to feet             inches to cm              gallons to liters
cm to inches               liters to gallons

Type help in interactive mode to see the full list.

Requirements

  • Python 3.8+
  • colorama (for colored output)
  • pyperclip (for clipboard support)

Installation

From PyPI

pip install calcli

From GitHub

git clone https://github.com/tolaoyelola/calcli.git
cd calcli
pip install -r requirements.txt
pip install -e .

Examples

# Basic math
calcli "100 + 50 * 2"
# Output: 200

calcli "(100 + 50) * 2"
# Output: 300

# Percentages
calcli "15% of 80"
# Output: 12

# Conversions
calcli "32 celsius to fahrenheit"
# Output: 89.60 fahrenheit

calcli "100 kg to lbs"
# Output: 220.46 lbs

calcli "5 inches to cm"
# Output: 12.70 cm

Special Commands (Interactive Mode)

help     Show all available commands and conversions
h        Display your last 10 calculations with results
exit     Quit calcli
q        Quit calcli (shorthand)

Contributing

Contributions welcome! Feel free to open issues or submit PRs.

License

MIT — See LICENSE file for details.

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

calcli-1.0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calcli-1.0.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file calcli-1.0.1.tar.gz.

File metadata

  • Download URL: calcli-1.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for calcli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 33be42eefcdf6f1e302ee9f01db609af537bd17542fa8f439f7b05526cbd4c76
MD5 fc33ed024024ccd8e886bb981d8048c2
BLAKE2b-256 bba4d4c1b5df5758732358c7dd15621af50d85b2c227f2a362dbacff420e754c

See more details on using hashes here.

File details

Details for the file calcli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: calcli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for calcli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b55d7a401ba375d7800c37748cd0ec31e300bb7ef2be3fab7c5c83284d6c2aff
MD5 9a3b4c5bbe1bf7590c79392f064577a4
BLAKE2b-256 292b3ed915485a421b8e929c4840b05dc47d65ec9fbcf6998ee0aa2cb79e5a31

See more details on using hashes here.

Supported by

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