Skip to main content

Python Wrapper for Toggl API

Project description

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

Tests Dependencies

To run the tests, you will need the following packages

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

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

python-toggl-0.1.12.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

python_toggl-0.1.12-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file python-toggl-0.1.12.tar.gz.

File metadata

  • Download URL: python-toggl-0.1.12.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.6

File hashes

Hashes for python-toggl-0.1.12.tar.gz
Algorithm Hash digest
SHA256 19052aa0c5870e09c65bebca7e9771f23d1a1c13130ae9c8a518021ef9c323a9
MD5 98438a55e5971085fe62576674a11d60
BLAKE2b-256 62c61e6c38833fec21f218cfc00fc861d9f93cfcac8c84b9e3e539a0b82cd12d

See more details on using hashes here.

File details

Details for the file python_toggl-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: python_toggl-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.18

File hashes

Hashes for python_toggl-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 7f95f261ca494aa1f9bca3685ecc69b3ae77b6ac98ee5bc307da2a34fb382414
MD5 745c0bf8560237b7717245d09df43b65
BLAKE2b-256 a8ec83e3a58de8ff76e6ba0da431763ddf5bb75e16eb190249e7073c5dc19c28

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