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 |
[!NOTE]
--week-startvalues: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
Metadata
Release files for utt-balance 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| utt_balance-0.1.1.tar.gz | 51.6 kB | Without provenance | Details for utt_balance-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| utt_balance-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for utt_balance-0.1.1-py3-none-any.whl |
Total release size: 72.4 kB
Release files / utt_balance-0.1.1.tar.gz
| Download URL | utt_balance-0.1.1.tar.gz |
|---|---|
| Size | 51.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39a9ca42494546540a918da189496b629f36e4cd8fa7513060559623b89e793d
|
|
BLAKE2b-256 checksum How to use checksums |
1e76ec4eff99f955645d8e2bd8775d646949715078253243a3c4ce6c1c67e880
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / utt_balance-0.1.1-py3-none-any.whl
| Download URL | utt_balance-0.1.1-py3-none-any.whl |
|---|---|
| Size | 20.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e309406d8b07cc6a5f8aa807bf323d5142f9a1cf24ff1eabaa250ccb0f96412b
|
|
BLAKE2b-256 checksum How to use checksums |
737427861f05fe71c68ba8b8512b4e5523fb1875740d0c2388be704bb82652cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for utt-balance 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.