โณ Terminal-based Pomodoro Timer

A simple command-line Pomodoro Timer written in Python for improving productivity using the Pomodoro Technique. It alternates between work and break sessions, helps reduce burnout, and includes a terminal beep as a reminder.


๐Ÿ“š What is the Pomodoro Technique?

The Pomodoro Technique is a time management method developed by Francesco Cirillo. It uses a timer to break work into intervals, traditionally:


๐Ÿง  What This Project Does


๐Ÿš€ How to Run

โœ… Requirements

โ–ถ๏ธ Run the Program

python pomodoro.py

๐Ÿงพ Code Explanation

โœ… import time

Used for:

โœ… def format_time(seconds)

Purpose: Converts total seconds to a readable format like mm:ss.

def format_time(seconds):
    mins = seconds // 60
    secs = seconds % 60
    return f"{mins:02d}:{secs:02d}"

Example: format_time(150) returns 02:30

โœ… Timer Settings

work_duration = 25 * 60
break_duration = 5 * 60
cycles = 4

You can change these values for quick testing (e.g. work_duration = 5 for 5 seconds).

โœ… The Loop: Running Pomodoro Cycles

for cycle in range(1, cycles + 1):

Runs the work + break cycle 4 times.

โœ… Work Timer

for remaining in range(work_duration, 0, -1):
    print(f"Work: {format_time(remaining)}", end='\r')
    time.sleep(1)

โœ… Break Timer

Same as work timer but uses break_duration.

โœ… Terminal Beep

print("\a")

This plays the bell sound in the terminal.


๐ŸŽจ Output Example

Pomodoro Cycle 1 - Work Time!
Work: 24:59
Work: 24:58
...

Time to take a break! ๐Ÿ””
Break: 04:59
Break: 04:58
...

Break over! Get ready to work again.

โœ… Features Summary

Feature Description
Timer Format Countdown in mm:ss format
Terminal Refresh Clean, single-line updates
Sound Alert Terminal bell \a at session end
Cycles 4 repeated Pomodoro sessions
Beginner-Friendly No external libraries, pure Python

๐Ÿงช Customize It!

What you want to change How to do it
Shorter testing times Change work_duration and break_duration to smaller numbers
More Pomodoros Change the value of cycles
Add long breaks Add a longer break after 4 cycles
Add GUI or sound files Use libraries like tkinter or playsound

๐Ÿ™Œ Contribution Ideas


๐Ÿ“ƒ License

This project is open-source and free to use for personal productivity!

๐Ÿ“‚ GitHub