A UTT plugin to check worked time balance against daily/weekly targets
Project description
utt-balance
A utt plugin that shows your worked time balance against daily and weekly targets.
Why utt-balance?
This plugin is designed as a quick time check to see how many hours you've worked and what your remaining time budget is. The name "balance" reflects its core purpose: supporting your work-life balance by encouraging you to stay within your pre-allocated work time.
The color coding tells the story:
- ๐ข Green โ You're under your target. You still have time remaining in your budget for the day or week.
- ๐ก Yellow โ You've hit exactly your target. This is a warning that you're about to dip into a deficit.
- ๐ด Red โ You've exceeded your allotted time. You're over 8 hours for the day or 40 hours for the week (by default).
Work ebbs and flowsโcertain days are more demanding than others, and that's okay. But having a quick visual check helps keep things on rails and reminds you to protect your time outside of work.
Features
- ๐ Daily & Weekly Tracking - See worked hours and remaining time at a glance
- ๐จ Color-coded Output - Green (under target), Yellow (at target), Red (over/negative)
- โ๏ธ Configurable Targets - Set custom daily hours, weekly hours, and week start day
- ๐ Native
uttIntegration - Usesutt's plugin API for seamless integration
Installation
Step 1: Install utt
First, install utt (Ultimate Time Tracker):
pip install utt
Verify the installation:
utt --version
Step 2: Install utt-balance
Install the plugin:
pip install utt-balance
That's it! The plugin is automatically discovered by utt. No additional configuration needed.
Verify Installation
Confirm the balance command is available:
utt balance --help
Requirements:
- Python 3.10+
utt>= 1.0
Usage
After installation, a new balance command is available in utt:
utt balance
Example Output
๐ข Under target โ time remaining in your budget:
๐ก At target โ you've hit your limit:
๐ด Over target โ you've exceeded your budget:
Options
| Option | Default | Description |
|---|---|---|
--daily-hrs |
8 | Target working hours per day |
--weekly-hrs |
40 | Target working hours per week |
--week-start |
sunday | Day the work week starts (monday, tuesday, wednesday, thursday, friday, saturday, sunday) |
Examples
Default usage (8h/day, 40h/week, week starts Sunday):
utt balance
Custom daily target โ set a 6-hour workday with --daily-hrs:
utt balance --daily-hrs 6
โโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ Worked โ Remaining โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโค
โ Today โ 5h00 โ 1h00 โ โ 1h until 6h target
โ Since Sunday โ 25h00 โ 15h00 โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโ
Custom weekly target โ set a 35-hour work week with --weekly-hrs:
utt balance --weekly-hrs 35
โโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ Worked โ Remaining โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโค
โ Today โ 6h30 โ 1h30 โ
โ Since Sunday โ 28h00 โ 7h00 โ โ 7h until 35h target
โโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโ
Change week start day โ use Monday with --week-start:
utt balance --week-start monday
โโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ Worked โ Remaining โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโค
โ Today โ 6h30 โ 1h30 โ
โ Since Monday โ 22h30 โ 17h30 โ โ week starts Monday
โโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโ
Part-time schedule โ combine options for 4h/day, 20h/week:
utt balance --daily-hrs 4 --weekly-hrs 20
โโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ Worked โ Remaining โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโค
โ Today โ 3h30 โ 0h30 โ โ 30min until 4h target
โ Since Sunday โ 15h00 โ 5h00 โ โ 5h until 20h target
โโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโ
Color Coding
| Color | Worked Column | Remaining Column |
|---|---|---|
| ๐ข Green | Under target | Time remaining |
| ๐ก Yellow | Exactly at target | Zero remaining |
| ๐ด Red | Over target | Negative (overtime) |
How It Works
This plugin uses utt's native plugin API to:
- Access your time entries directly (no subprocess calls)
- Filter activities for today and the current week
- Calculate total working time (excludes breaks marked with
**) - Compare against your configured targets
License
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Development
Running Tests
To run the test suite, first install the development dependencies:
pip install -e ".[dev]"
Then run the tests with pytest:
pytest
For coverage reporting:
pytest --cov=utt_balance.balance --cov-report=term-missing
Linting & Formatting
Run ruff (linter, formatter, and import sorting):
# Check for linting errors
ruff check .
# Auto-fix linting errors (including import sorting)
ruff check --fix .
# Format code
ruff format .
Type Checking
Run ty (type checker):
ty check src/
Run All Checks
ruff check --fix . && ruff format . && ty check src/ && pytest
Pre-commit Hooks
Install pre-commit hooks to automatically run checks before each commit:
pre-commit install
Run hooks manually on all files:
pre-commit run --all-files
Contributing
Contributions are welcome! Here's how to get started:
Setting Up for Development
-
Clone the repository:
git clone https://github.com/loganthomas/utt-balance.git cd utt-balance
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install in editable mode with dev dependencies:
pip install -e ".[dev]"
-
Install pre-commit hooks:
pre-commit install
Submitting Changes
- Create a new branch for your feature or fix
- Make your changes following the code style guidelines
- Ensure all tests pass:
pytest - Ensure code passes linting:
ruff check . && ruff format --check . - Submit a pull request with a clear description of your changes
Code Style Guidelines
- Follow PEP 8 conventions
- Use type hints for all function signatures
- Write docstrings in NumPy style
- Keep functions focused and single-purpose
- Prefer explicit over implicit
Related
utt(Ultimate Time Tracker) - The time tracking tool this plugin extendsuttPlugin Documentation - How to createuttplugins
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file utt_balance-0.1.0rc2.tar.gz.
File metadata
- Download URL: utt_balance-0.1.0rc2.tar.gz
- Upload date:
- Size: 51.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
595bdbbe3a6055e15c8b176cf164468e3fe02af896c61887fdeb5dde93f6ea6f
|
|
| MD5 |
ab640b44addfd88ad66a12b5f8d907e8
|
|
| BLAKE2b-256 |
2c6ae947d3a986c3821bc7cdbdbbd41ee54c285c6f07672243cb7a672570635d
|
File details
Details for the file utt_balance-0.1.0rc2-py3-none-any.whl.
File metadata
- Download URL: utt_balance-0.1.0rc2-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d531d34b8f8ef8229fc7e4e1d198825c7b3ddc687ae6b21964f9a21972f2efeb
|
|
| MD5 |
3dff76f1d825464e92d946bb5d495b8b
|
|
| BLAKE2b-256 |
87e0ef63e93add77f419880f9fa11f2bbd1aafda038d7cb2765b27cf864cf9a7
|