Skip to main content

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.

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.

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 under src/, tests under tests/, and CI configuration under .github/.
team-practice/
├── src/
│   ├── __init__.py        # Paquete Python
│   ├── calculator.py      # Lógica matemática (funciones puras)
│   ├── cli.py             # Interfaz de línea de comandos
│   └── gui.py             # Interfaz gráfica con tkinter
├── tests/
│   ├── __init__.py        # Paquete de tests
│   ├── conftest.py        # Mocks de tkinter para pruebas headless
│   ├── test_calculator.py # Tests unitarios del core
│   └── test_gui.py        # Tests de la interfaz gráfica
├── .github/
│   └── workflows/ci.yml   # Pipeline de CI/CD con GitHub Actions
├── docs/
│   └── USER_GUIDE.md
├── CHANGELOG.md
├── requirements.txt
└── LICENSE

Version history

The project follows Semantic Versioning. Each release is fully documented in the CHANGELOG.
VersionDateKey changes
1.0.02025-11-04Initial CLI calculator with basic arithmetic, scientific functions, error handling, and pytest
2.0.02025-11-28tkinter GUI, keyboard shortcuts, automated GUI tests with headless mocks, GitHub Actions CI/CD
2.1.02025-12-03Parenthesized 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.

Build docs developers (and LLMs) love