Skip to main content

Easily interface with Toggl's API.

Project description

Python library to easily interface with Toggl’s API.

Only supports the main Toggl API, not the Reports API (coming soon).

Works in Python 2.7+ and Python 3+, and uses requests .

Toggl

Toggl is free time tracking software.

Features

  • Handles authentication for you: only need to provide your API token once

  • The most complete Python wrapper: implements all of v8 API.

  • Convenient install from PyPI

  • Easy to make requests to custom URLs

  • Python2 and Python3 compatible

Install

$ pip install togglwrapper

Quickstart

>>> from togglwrapper import Toggl
>>> toggl = Toggl('your_api_token')``
>>> toggl.User.get()
{u'data': {u'achievements_enabled': True,
u'api_token': u'your_api_token',
u'email': u'your_email@domain.com',
u'fullname': u'Your Name',
...
}
>>> toggl.Clients.get()
[{u'at': u'2015-07-02T14:27:59+00:00',
u'id': 12031893,
u'name': u'Client Name',
u'wid': 3928}]
>>> toggl.Workspaces.get()
[{u'admin': True,
u'api_token': u'your_api_token',
u'id': 1234,
u'name': u"Your workspace",
...
}]
>>> toggl.Clients.create({"client":{"name":"Very Big Company", "wid": 1234}})
{u'data': {u'id': 294021, u'name': u'Very Big Company', u'wid': 1234}}

Custom Request

Let’s pretend that a new endpoint is released, for a new Toggl object: Addresses. This hypothetical endpoint is located at https://www.toggl.com/api/v8/addresses. We can GET all addresses, GET a specific address by ID, or POST to create a new address.

We can use the methods on the Toggl client, so we don’t have to wait for a new version of togglwrapper that supports the new endpoint:

>>> from togglwrapper import Toggl
>>> toggl = Toggl('your_api_token')
>>> toggl.get('/addresses')
...
>>> toggl.get('/addresses/{address_id}')
...
>>> toggl.post('/addresses', data={"address": {"name": "Billing Address 1", "address": "123 Main St."}})
...

toggl.put and toggl.delete are also available.

Documentation

Find the full documentation here: http://togglwrapper.readthedocs.org/en/latest/

Methods and Classes

  • toggl.Clients

  • toggl.Dashboard

  • toggl.Projects

  • toggl.ProjectUsers

  • toggl.Tags

  • toggl.Tasks NOTE: user associated with the api token must be a Pro member

  • toggl.TimeEntries

  • toggl.User

  • toggl.Workspaces

  • toggl.WorkspaceUsers

  • toggl.signup()

  • toggl.reset_token()

API Endpoints Documentation

For full details on what fields are required, and what endpoints are available, see the Toggl API docs

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

togglwrapper-1.0.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

togglwrapper-1.0.1-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file togglwrapper-1.0.1.tar.gz.

File metadata

File hashes

Hashes for togglwrapper-1.0.1.tar.gz
Algorithm Hash digest
SHA256 df72f15e9f041b1fe350304a4b100ca4a39b4589d52c1d85c96920b03a5c91db
MD5 66c5b7cec489bb9283f3048b15503ead
BLAKE2b-256 af383a1bd4a8338ea4ecac6cc88cc68a58f80b2305ab1dff61b34497ca5a2af5

See more details on using hashes here.

File details

Details for the file togglwrapper-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for togglwrapper-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a9c9e09b6a7587c42ffbade9ca87503cdd6f286e43b6c8bf23b80db4878e9412
MD5 e4bff537343d18bb8f4150b87f0956ef
BLAKE2b-256 adeb379881396cf80c0fc7d00c307b7ec5426b58586a57db9fef2ce681804ad0

See more details on using hashes here.

Supported by

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