Skip to main content

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

Project description

Toggl CLI

PyPI version PyPI - Python Version PyPI - Downloads codecov Build Status Codacy Badge Updates

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

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

togglCli-2.4.1.tar.gz (104.0 kB view details)

Uploaded Source

Built Distribution

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

togglCli-2.4.1-py2.py3-none-any.whl (86.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file togglCli-2.4.1.tar.gz.

File metadata

  • Download URL: togglCli-2.4.1.tar.gz
  • Upload date:
  • Size: 104.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.1

File hashes

Hashes for togglCli-2.4.1.tar.gz
Algorithm Hash digest
SHA256 5118e7bf9f33efe2141a7c8591cc6a054842fd68d1c3b7d7afdf7ed614f299a6
MD5 26f454bb312309b984a9c6d4219a5826
BLAKE2b-256 8c10454da6a4f1f24eeda5405c82551afdab043fe248b3c9311a37be6c30d281

See more details on using hashes here.

File details

Details for the file togglCli-2.4.1-py2.py3-none-any.whl.

File metadata

  • Download URL: togglCli-2.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 86.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.1

File hashes

Hashes for togglCli-2.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 85f03cc8cc8f61ba87dd59885c61c9a5f9e39febc5d1c4060fc55c730376abf2
MD5 470c380fe93ef7df2e831c3965dda285
BLAKE2b-256 3ac0a57cd5ce6b65a807aa485e7baf331f64ce98233a1065c43dab1dacb377db

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