Skip to main content

Toggl CLI

PyPI version PyPI - Python Version PyPI - Downloads codecov Build Status

Command line tool and set of Python wrapper classes for interacting with toggl's API

Install

Easiest way to install this package is through PyPi:

$ pip install togglCli

Usage

For full overview of Toggl CLI capabilities please see full documentation.

CLI tool

With first run of the command you will be asked several questions to bootstrap default config file (only UNIX-like system are supported; for Window's users there is created dummy config file, which you have to setup manually).

To get overview of all commands and options please use --help option. Check out also help pages of the subcommands!

Several examples of commands:

# Starts tracking new time entry
$ toggl start

# Displays/enable modifications of currently running time entry
$ toggl now

# Lists all projects
$ toggl projects ls

API wrappers

Toggl CLI comes with set of Python's class wrappers which follow similar pattern like Django ORM.

The wrappers depends on config object which if not provided, the default config file (eq. ~/.togglrc) is used.

Toggl CLI uses pendulum for datetime management, but it is compatible with Python's native datetime, so you can use that if you want to.

from toggl import api, utils
import pendulum

new_entry = api.TimeEntry(description='Some new time entry', start=pendulum.now() - pendulum.duration(minutes=15), stop=pendulum.now())
new_entry.save()

list_of_all_entries = api.TimeEntry.objects.all()

current_time_entry = api.TimeEntry.objects.current()

# Custom config from existing file
config = utils.Config.factory('./some.config')

# Custom config without relying on any existing config file 
config = utils.Config.factory(None)  # Without None it will load the default config file
config.api_token = 'your token'
config.timezone = 'utc'  # Custom timezone

project = api.Project.object.get(123, config=config)
project.name = 'Some new name'
project.save()

Contributing

Feel free to dive in, contributions are welcomed! Open an issue or submit PRs.

For PRs please see contribution guideline.

License

MIT © Adam Uhlir & D. Robert Adams

Release files for togglCli 4.0.1

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

Source distribution (sdist)

Source distribution for togglCli 4.0.1
File Size Uploaded
togglcli-4.0.1.tar.gz 114.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for togglCli 4.0.1
File Interpreter ABI Platform
togglcli-4.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 202.0 kB

Release files / togglcli-4.0.1.tar.gz

Download URL togglcli-4.0.1.tar.gz
Size 114.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cb2bd8ba999204dd1ee9a81e57fad9cc1240812ec5532dd897d162d3c4ee666e
BLAKE2b-256 checksum
How to use checksums
678b98b2d68927983f80f59b44d0e183b382d0df74303f5427af50b9efab4a72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / togglcli-4.0.1-py2.py3-none-any.whl

Download URL togglcli-4.0.1-py2.py3-none-any.whl
Size 87.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
527a396bd9321a5dc4158248a840ca7e831e0a0214997ba177d958f3cc30f238
BLAKE2b-256 checksum
How to use checksums
5959eeb907075ce6f0a8115424b6349b82923c77b6ccda4850024b3d15e184e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7
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