Command line tool and set of Python wrapper classes for interacting with toggl's API
Project description
Toggl CLI
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
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
File details
Details for the file togglCli-3.0.2.tar.gz
.
File metadata
- Download URL: togglCli-3.0.2.tar.gz
- Upload date:
- Size: 114.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2066dded9831d68be11d585e1c9d465c462584ac60a55455995a4dd978e7ea65 |
|
MD5 | a4fddfbda6608e27a07e8c2bc06247d8 |
|
BLAKE2b-256 | 3264e2764a269bac05ca292b8fc2d78c2235568de8bfdd8f05d59c51d7142243 |
File details
Details for the file togglCli-3.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: togglCli-3.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 87.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db57157036785ad769ee29bac7f1e5c7a7ff7d9d290204bc7e2c85eebc3a252b |
|
MD5 | 30887333f065a45dbb4d312a5c206385 |
|
BLAKE2b-256 | 16a16ecd7dc7cd66a960bbe7fc00dc55940cb55260feb7f9de0bcee365145131 |