A simple, accurate countdown timer application built with Python and Kivy framework.
- Input field for timer duration (0-300 seconds)
- Start button to begin countdown
- Real-time timer display with 0.1 second precision
- Input validation
- Clean, modern UI with vertical layout
- Python 3.x
- Kivy 2.3.1 and dependencies (see requirements.txt)
- Clone this repository:
git clone https://github.com/yourusername/kivy-countdown-timer.git
cd kivy-countdown-timer
- Set up a virtual environment and install the dependencies:
make setup
or manually:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
make run
or manually:
python main.py
- Enter a time value between 0 and 300 seconds
- Click the "Start" button
- Watch the countdown
- The Start button will be re-enabled when the timer completes
main.py
- Application entry pointcountdown_timer.py
- UI component definitiontimer_logic.py
- Timer business logictimer_unittest.py
- Unit tests for timer accuracymakefile
- Build and run automationrequirements.txt
- Project dependencies
make test
make format
make build
make freeze
The application is divided into three main components:
- UI Layer (
countdown_timer.py
): Handles the visual elements and user interaction - Logic Layer (
timer_logic.py
): Manages timer functionality, validation, and callbacks - Application Layer (
main.py
): Sets up the Kivy application and window properties
The timer uses Kivy's Clock scheduler to update the countdown display at 0.05-second intervals, ensuring smooth and accurate time progression.
The application includes unit tests that verify:
- Timer accuracy across different durations
- Input validation functionality
- Proper callback execution
- Timer completion events