A modular and reliable Command Line Interface (CLI) application built with Python for converting temperatures between Celsius, Fahrenheit, and Kelvin.
The project focuses on clean architecture, strong input validation, and accurate temperature calculations while preventing common runtime errors.
-
Input Validation
- Prevents invalid data types and unexpected user inputs.
- Blocks scientifically impossible values such as negative Kelvin temperatures.
-
Accurate Temperature Conversion
- Supports conversion between:
- Celsius (°C)
- Fahrenheit (°F)
- Kelvin (K)
- Provides clean output with decimal rounding for better readability.
- Supports conversion between:
-
Modular Architecture
- Separates responsibilities into different files:
- Conversion logic
- Input handling
- Application control
- Separates responsibilities into different files:
-
Error Handling
- Handles invalid inputs safely.
- Prevents crashes from
KeyboardInterruptandEOFError. - Provides a smooth user experience in the terminal.
Temperature-Converter-CLI/
│
├── temperature_converter.py # Core temperature conversion logic
├── input_taker.py # Handles user input and validation
└── main.py # Main CLI application controller
-
Make sure Python is installed.
-
Clone the repository:
git clone <repository-url>- Navigate to the project folder:
cd Temperature-Converter-CLI- Run the application:
python main.pyEnter temperature value: 100
Convert from: Celsius
Convert to: Fahrenheit
Result: 212.00°F
This project was created to practice:
- Python modular programming
- Exception handling
- Input validation
- Clean CLI application design
- Writing maintainable code
This project is open-source and available for learning and improvement.