Skip to main content

A utt plugin to show projects sorted by time spent

Project description

utt-project-summary

CI - Test PyPI Latest Release PyPI Downloads License - GPL-3.0 Python Versions

A utt plugin that shows projects sorted by time spent.

Why utt-project-summary?

This plugin provides a quick overview of how your time is distributed across different projects. It groups all activities by project and displays them sorted by total duration, giving you instant visibility into where your time is going.

Key features:

  • 📊 Project Breakdown — See all projects sorted by time spent (highest to lowest)
  • 📈 Percentage View — Optionally show percentage of total time for each project
  • ⏱️ Current Activity — Shows your current activity and includes it in totals
  • 📅 Flexible Date Ranges — Report by day, week, month, or custom date ranges

Features

  • 📊 Project-Based View - Activities grouped by project, sorted by duration
  • 🔢 Optional Percentages - Add --show-perc to see time distribution percentages
  • 📅 Date Range Support - Use --from, --to, --week, or --month flags
  • 🔌 Native utt Integration - Uses utt'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-project-summary

Install the plugin:

pip install utt-project-summary

That's it! The plugin is automatically discovered by utt. No additional configuration needed.

Verify Installation

Confirm the project-summary command is available:

utt project-summary --help

Requirements:

  • Python 3.10+
  • utt >= 1.0

Usage

After installation, a new project-summary command is available in utt:

utt project-summary

Example Output

Project Summary
---------------

backend : 4h30
frontend: 2h15
meetings: 1h45
docs    : 0h30

Total   : 9h00

With Percentages

utt project-summary --show-perc
Project Summary
---------------

backend : 4h30 ( 50.0%)
frontend: 2h15 ( 25.0%)
meetings: 1h45 ( 19.4%)
docs    : 0h30 (  5.6%)

Total   : 9h00 (100.0%)

Options

Option Default Description
--show-perc false Show percentage of total time for each project
--from none Inclusive start date for the report
--to none Inclusive end date for the report
--week none Report for a specific week (this, prev, or week number)
--month none Report for a specific month (this, prev, 2024-10, Oct)
--project none Filter to show only a specific project
--current-activity -- Current Activity -- Set the current activity name
--no-current-activity false Do not display the current activity

Examples

Default usage (today's activities):

utt project-summary

Show with percentages:

utt project-summary --show-perc

This week's summary:

utt project-summary --week this

Last month's summary:

utt project-summary --month prev

Custom date range:

utt project-summary --from 2024-01-01 --to 2024-01-31

How It Works

This plugin uses utt's native plugin API to:

  1. Access your time entries directly (no subprocess calls)
  2. Filter activities based on date range arguments
  3. Group activities by project name
  4. Sort projects by total duration (descending)
  5. Optionally calculate percentages of total time

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_project_summary --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

  1. Clone the repository:

    git clone https://github.com/loganthomas/utt-project-summary.git
    cd utt-project-summary
    
  2. Create a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install in editable mode with dev dependencies:

    pip install -e ".[dev]"
    
  4. Install pre-commit hooks:

    pre-commit install
    

Submitting Changes

  1. Create a new branch for your feature or fix
  2. Make your changes following the code style guidelines
  3. Ensure all tests pass: pytest
  4. Ensure code passes linting: ruff check . && ruff format --check .
  5. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

utt_project_summary-0.1.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

utt_project_summary-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file utt_project_summary-0.1.0.tar.gz.

File metadata

  • Download URL: utt_project_summary-0.1.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for utt_project_summary-0.1.0.tar.gz
Algorithm Hash digest
SHA256 26067bb5adf7abb109e51dd057d857ec72a427363807f0fdc87de5a20e33ea1b
MD5 29e2e036285a91596edb65292937565b
BLAKE2b-256 4a27fa6d9350fabf4eac5a1adc060f289cfd691e5c348868d6286ce5df44603a

See more details on using hashes here.

File details

Details for the file utt_project_summary-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for utt_project_summary-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 621f83fd9ee99d3bf858db40c19182e6697678e506bbfc8ce596b096da38be89
MD5 a1015c0e5170ecfadf6429dbf6bcb9e2
BLAKE2b-256 73303fd404f6d8195977ef450779316dfa6000fb2745ba1b7db11b1707b91063

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page