PyToggl
The definitive Toggl library for Python.
Currently this library supports all API calls via the self.query and the self.query_report methods. They return the JSON that is documented in the Toggl API documentation.
In addition to the query methods, this library contains quite a few helpful methods and classes for working with Toggl data.
How To Use / Examples
Initialize the Library
from PyToggl import PyToggl
pytoggl = PyToggl('YOUR-API-KEY-HERE')
# Wasn't that easy?
Now do something with it.
# Grab our workspace(s)
workspaces = pytoggl.get_workspaces()
# Now grab all our users for the first workspace
users = pytoggl.get_workspace_users(workspaces[0].id)
Code:
# PyToggl creates objects out of all your query results that use the
# helper methods (ie. get_workspaces and get_workspace_users)
print(users[0].name)
Output:
John Smith
Code:
# The repr is very useful for debugging.
print(users[0])
Output:
class instance>.wid = 12345 class instance>.uid = 543210 class instance>.admin = False class instance>.avatar_file_name = https://secure.gravatar.com/avatar/87vh8r7h8er7ch8wd7ch9wd7cj9wr7h?d=404&s=200 class instance>.id = 987656789 class instance>.inactive = False class instance>.at = 2014-09-26T17:54:54+00:00 class instance>.active = True class instance>.group_ids = [345678] class instance>.email = johnsmith@notarealdomain.com class instance>.name = John Smith
Code:
# All objects have a dict property.
print(users[0].dict)
Output:
{'active': True,
'admin': False,
'at': u'2014-09-26T17:54:54+00:00',
'avatar_file_name': u'https://secure.gravatar.com/avatar/87vh8r7h8er7ch8wd7ch9wd7cj9wr7h?d=404&s=200',
'email': u'johnsmith@notarealdomain.com',
'group_ids': [345678],
'id': 987656789,
'inactive': False,
'name': u'John Smith',
'uid': 543210,
'wid': 12345}
Code:
# All objects also have a json property
print(users[0].json)
Output:
'{"wid": 12345, "uid": 543210, "avatar_file_name": "https://secure.gravatar.com/avatar/87vh8r7h8er7ch8wd7ch9wd7cj9wr7h?d=404&s=200", "inactive": false, "at": "2014-09-26T17:54:54+00:00", "active": true, "id": 987656789, "group_ids": [345678], "name": "John Smith", "admin": false, "email": "johnsmith@notarealdomain.com"}'
CHANGES
Version 0.1.0 - 02 October 2014
Alpha version
Metadata
Release files for PyToggl 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyToggl-0.2.6.tar.gz | 6.1 kB | Without provenance | Details for PyToggl-0.2.6.tar.gz |
Release files / PyToggl-0.2.6.tar.gz
| Download URL | PyToggl-0.2.6.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04018e565a9e04e339d98118d93974495be8a909f7899d87022f1c41f4254067
|
|
BLAKE2b-256 checksum How to use checksums |
e606fe743d00b5987c54ea2b20ad218d77afb2f664f0b1b95853b0c7736e3403
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for PyToggl 0.2.6
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.