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.0.tar.gz (5.5 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.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: calcli-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 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.0.tar.gz
Algorithm Hash digest
SHA256 bdad082dfabce8c40cba6dcef0f461d1ebb905c13c848402f7ef6006209d998b
MD5 a8efb1a3a14c4686cc519a4992315062
BLAKE2b-256 0d6586b4f536cb15c69ae76d40198efa4fc8c269ba59f226be299c6201b0d0f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: calcli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af5690cd5f719923b4f28a69fb03288c47a45038b33356fbdb091b7534635c5b
MD5 335c95fc8e3af1187132211700f61be6
BLAKE2b-256 ee80bc163b0ee5a300e520b3a860828eb8997fe6cc7d727ecdaa585fff94396a

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