Python Calculator is an open-source project that delivers a fully featured calculator in two interfaces: a dark-themed graphical window built with tkinter and an interactive command-line shell. Designed for both practical everyday use and as a collaborative learning reference, the codebase demonstrates clean Python architecture, automated testing with pytest, and a Git Flow workflow with Conventional Commits — making it an ideal starting point for teams learning professional software development practices.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/WorkTeam01/team-practice/llms.txt
Use this file to discover all available pages before exploring further.
Features
Core Math Library
Pure-function module (
src/calculator.py) covering addition, subtraction, multiplication, division, and exponentiation — fully unit-tested and importable by both interfaces.Graphical Interface (GUI)
A responsive dark-themed tkinter window with a numeric keypad, operator buttons, scientific functions, and full keyboard shortcut support.
Command-Line Interface (CLI)
An interactive REPL (
src/cli.py) that parses expressions entered as plain text, supports all operators and scientific functions, and handles errors gracefully.Parenthesized Expressions
Both interfaces evaluate arbitrarily nested expressions such as
(2+3)*4, ((2+3)*4)/5, and (2+3)^2 with balanced-parenthesis validation.Automated Testing
A 63+ test suite covering the math core and the GUI (using headless tkinter mocks via
tests/conftest.py) that runs in any CI environment without a display.CI/CD Pipeline
A GitHub Actions workflow (
.github/workflows/ci.yml) that executes the full test suite automatically on every push and pull request to main and dev.Project structure
The repository follows a standard Python package layout with source code undersrc/, tests under tests/, and CI configuration under .github/.
Version history
The project follows Semantic Versioning. Each release is fully documented in the CHANGELOG.| Version | Date | Key changes |
|---|---|---|
| 1.0.0 | 2025-11-04 | Initial CLI calculator with basic arithmetic, scientific functions, error handling, and pytest |
| 2.0.0 | 2025-11-28 | tkinter GUI, keyboard shortcuts, automated GUI tests with headless mocks, GitHub Actions CI/CD |
| 2.1.0 | 2025-12-03 | Parenthesized expressions, project reorganization into src/ and tests/, bug fixes |
Ready to get the project running? Head over to the Installation guide to set up your environment, then follow the Quickstart to perform your first calculation in under two minutes.
