Skip to content

πŸš€ A production-grade CLI calculator showcasing advanced Python engineering: Immutable architecture with @DataClass, strict type hinting, custom exception hierarchies, and a full Pytest suite. Structured for scalability with modern PEP 517 standards.

License

Notifications You must be signed in to change notification settings

cherryaugusta/advanced-python-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Advanced Python Calculator

Overview

This project is a professional, command-line based calculator designed to demonstrate advanced Python programming practices, clean software architecture, and strong GitHub repository standards. It significantly improves upon basic procedural calculator examples by applying object-oriented design, immutability, exception handling, testing, and modular structure.

Features

  • Immutable calculator core using @dataclass
  • Strong input validation and custom exceptions
  • Clean separation of business logic and CLI interface
  • Fully testable design with pytest
  • Python type hints for clarity and correctness
  • Production-ready repository structure

Project Structure

advanced-python-calculator/ β”œβ”€β”€ src/calculator # Application source code β”œβ”€β”€ tests # Unit tests β”œβ”€β”€ README.md β”œβ”€β”€ LICENSE └── pyproject.toml

Installation

git clone https://github.com/cherryaugusta/advanced-python-calculator.git
cd advanced-python-calculator
python -m venv .venv
source .venv/bin/activate
pip install -e .

Running the Application

python -m calculator.cli

Example Usage

Enter a: 10 Enter b: 5

1 - Addition 2 - Subtraction 3 - Multiplication 4 - Division 0 - Restart Any other key - Exit

Your choice: 4 Result: 2.0

Running Tests

pytest

Design Principles Demonstrated

β€’ Single Responsibility Principle β€’ Immutability β€’ Explicit error handling β€’ Test-driven mindset β€’ Clean CLI interfaces β€’ Readable, maintainable code

Disclaimer

This project is created strictly for educational purposes and portfolio demonstration only. It is not intended for production financial calculations or mission-critical systems.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

πŸš€ A production-grade CLI calculator showcasing advanced Python engineering: Immutable architecture with @DataClass, strict type hinting, custom exception hierarchies, and a full Pytest suite. Structured for scalability with modern PEP 517 standards.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages