Skip to main content

Toggl Tally

Supported Python Versions PyPI version

Tests

Toggl tally is a rich Python command line interface for tracking progress against your monthly project targets and calculating the daily hours you need to work to hit your goals. Toggl tally connects to the Toggl Track API, and supports:

  • Filtering by workspaces, clients or projects
  • Configurable invoicing day of month
  • Configurable weekly working days
  • Excluding (and reporting upcoming) public holidays in your configured country

Installation

Install using pip:

pip install toggl-tally

Setup

Toggl API token

Toggl tally handles connection to the Toggl Track API; all you need to do is make your Toggl API token available as an environment variable. Get your Toggl API token from the Toggl profile page and set it as the TOGGL_API_TOKEN environment variable.

Configuration

Toggl tally needs to be configured with your monthly goals and projects. This configuration can be passed either via a YAML file or via command line arguments and options. YAML file configuration is the most streamlined and DRY for daily use.

The path to the YAML config file can either be passed as a command-line argument (toggl-tally -c /path/to/config.yaml) or can be detected automatically from the environment variable TOGGL_TALLY_CONFIG.

Help

The configurable keys are as below, and a full example yaml config is provided with this repo.

hours_per_month: 160
invoice_day: 18
workspaces:
clients:
  - MegaCorp
projects:
  - Widget Building
skip_today: false
timezone: Africa/Johannesburg
working_days:
  - MO
  - TU
  - WE
  - TH
  - FR
country: ZA
exclude_public_holidays: true

Alternatively, all configuration can be passed with command-line arguments to the hours command. See the CLI help for detailed information about each argument and option.

Help

Toggl data model and filtering

erDiagram
    WORKSPACE ||--o{ CLIENT : has
    WORKSPACE ||--o{ PROJECT : has
    WORKSPACE ||--o{ TIME_ENTRY : has
    CLIENT |o--|{ PROJECT : has
    PROJECT |o--o{ TIME_ENTRY : has

toggl_tally enables filtering by multiple workspace, client or project names. The UNION across all of these entities is taken to determine the final set of time entries. For example, for the filter criteria:

workspaces:
clients:
  - MegaCorp
  - HyperCorp
projects:
  - Widget Building
  - Baz refactoring

A time entry will be included if it:

  • Belongs to a project linked to the MegaCorp client OR
  • Belongs to a project linked to the HyperCorp client OR
  • Belongs to the Widget Building project OR
  • Belongs to the Baz refactoring project

Hours command

The hours command is the core command for Toggl tally. It reports:

  • Working days to go before next invoice date
  • Daily hours needed to hit monthly target by next invoice date
  • Hours worked on relevant projects since last invoice
  • A monthly progress bar

Hours

The hours command has a --verbose (-v) flag, which if enabled also reports:

  • Active workspace, project and client filters
  • Upcoming public holidays in the working period

Hours

Development

To install toggl_tally for development, run:

pip install -e '.[dev]'

Code for this repository is checked using pre-commit. After cloning this repository please run the following steps to initialise pre-commit:

pre-commit install --install-hooks

The following hooks are automatically run when new commits are made:

  • From pre-commit hooks:
    • end-of-file-fixer
    • trailing-whitespace
    • check-yaml
    • check-added-large-files (max. 500kb)
  • black Python code format checking
  • flake8 Python code linting
  • isort Python code import ordering

Metadata

Release files for toggl-tally 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toggl-tally 0.1.2
File Size Uploaded Provenance
toggl-tally-0.1.2.tar.gz 48.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for toggl-tally 0.1.2
File Interpreter ABI Platform
toggl_tally-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 85.8 kB

Release files / toggl-tally-0.1.2.tar.gz

Download URL toggl-tally-0.1.2.tar.gz
Size 48.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4ea9922f1691b15f45612931bc6c67e293d3b86b11376d47dceaf43373e68643
BLAKE2b-256 checksum
How to use checksums
ad433069e5b88eef75d64a0c853ed5a209c9a2bc5be3b53eec8dee2581d4fc16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / toggl_tally-0.1.2-py3-none-any.whl

Download URL toggl_tally-0.1.2-py3-none-any.whl
Size 36.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e37dab0f7ead463a0b7079d115d5a3f328deab4ca4c9e0b389ace8bb7576de7c
BLAKE2b-256 checksum
How to use checksums
6839b1d4d81dcb8b9d59d3be6ce02de89fd2b54e2f782bb307682811ade98a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Security for toggl-tally 0.1.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page