toggl-python-api-client
Toggl is an “insanely simple time tracking” service.
This specific library is a Python-based REST client to interface with the Toggle API utilizing requests.
This library is a pure api client to help other python apps interface with Toggl. I created this project primarily to help with a bigger internal project that I am doing at work while at the same time getting my feet wet in Python.
Others out there
There is already a similar library, toggl_target though it is more of an application and the client api is not separate repo. Some ideas/concepts on the client api were taken from there but I had needed a client api only to help interface with my bigger app.
Usage
Pypi Package
pip install python-toggl
Manual installation
Download to a location of your choice and do the following.
from toggl.api_client import TogglClientApi
settings = {
'token': 'xxx',
'user_agent': 'your app name'
}
toggle_client = TogglClientApi(settings)
response = toggle_client.get_workspaces()
Dependencies
Python 2.7 onwards
Tests Dependencies
To run the tests, you will need the following packages
unittest
json
Tests
Tests created under /tests are primarily integration tests and are not strictly unit tests. They consists of an offline and online(live) test.
Offline
tests/tests_offline.py
These tests are for the logic of the api client. They do not connect to the actual Toggl servers - instead use httpretty to mock the responses. Sample responses are included in tests/json_responses and are based on Toggle responses for V8 of the main api and V2 of the report api.
Online/Live
tests/tests_live.py
These tests are to check the connections to Toggl’s API and to ensure that the client is handling the live responses from Toggl as expected.
To avoid adding sensitive data to version control, no api credentials have been included. To enable live tests, - make a copy of tests/tests_live_config.json.sample as tests/tests_live_config.json - update the settings on tests/tests_live_config.json as needed
Metadata
Release files for python-toggl 1.1.0
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 |
|---|---|---|---|---|
| python-toggl-1.1.0.tar.gz | 10.8 kB | Without provenance | Details for python-toggl-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_toggl-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for python_toggl-1.1.0-py3-none-any.whl |
Total release size: 22.0 kB
Release files / python-toggl-1.1.0.tar.gz
| Download URL | python-toggl-1.1.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
244c084489729e1daa08d61cc64cd39ce3c809d8834f40c382cfcb086f0b59a4
|
|
BLAKE2b-256 checksum How to use checksums |
b7a46812d7bc5ce8d6b0d174fe6a41505a8e06570ebe2c8a9baa0cf11b5a5d99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.18
|
Release files / python_toggl-1.1.0-py3-none-any.whl
| Download URL | python_toggl-1.1.0-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d71c34b9a600ff39a2cd7f3b64daa21f2339f669dbc3c28424a296b5250af173
|
|
BLAKE2b-256 checksum How to use checksums |
ba1ca40ae5f67c771e0c0c924f4dd5fb440b2d8954e5baac531147a1abd85106
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.18
|
Security for python-toggl 1.1.0
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.