Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Python Hours and Pay Calculator

A lightweight Python utility designed to aggregate tracked time (minutes and seconds) and calculate earnings based on an hourly rate.

Why this project?

When tracking freelance or contract work, time is often recorded in fragments of minutes and seconds. Manually converting these totals into exact decimal hours to calculate fair pay can be tedious and prone to rounding errors.

I built this project to automate that workflow. Unlike basic calculations that commpletely drop leftover minutes or round aggressively, this script converts the entire time tracking history down to the second, ensuring precise, to-the-penny compensationfor fractional hours worked.

Features

  • Precise Conversions: Leverages Python's built-in 'divmod()' function for clean, efficient time formatting.
  • Fractional Pay Calculation: Ensures accurate compensation by calculating pay using exact decimal hours, not just whole hours.
  • Zero Dependencies: Uses entirely vanilla Python with standard libraries-no external installations required.

How It Works

The core function accepts two lists (one for minutes, one for seconds) and an optional hourly rate:

calculate_pay(minutes_list, seconds_list, rate=17)

Example Input

mins_list = [33, 36, 31, 37, 25, 49, 28, 33, 34]
secs_list = [29, 28, 12, 13, 52, 30, 28]

Example Output

Your total time worked is 5 hours and 10 minutes.
Your total pay is $87.89

Requirements and Installation

  • Python 3.x (Built and tested using Python 3.12)
  • No external libraries or virtual environments needed.

Simply clone the repository and run the script:

git clone [https://github.com/brendaSzu/pay-calculator.git](https://github.com/brendaSzu/pay-calculator.git)
cd pay-calculator
python pay_calculator.py

Project Roadmap & Future Plans

This utility is the foundational block for a larger, comprehensive financial tracking application. Future iterations will expand this script into a full-featured tool to help independent contractors manage their income.

Planned features include:

  • Persistent Storage: Integrating a local database (like SQLite) or data tracking framework to save multiple work sessions.
  • Automated Tax Estimation: Building logic to calculate and maintain a running total of estimated quarterly taxes owed based on current tax brackets.
  • Graphical User Interface (GUI): Wrapping the backend logic in a clean visual interface for seamless data entry and tracking.

About

A lightweight Python utility designed to aggregate tracked time in minutes and seconds, eliminating tedious extra work and rounding errors.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages