Skip to main content

tempo-api-python-client

Python bindings for Tempo Rest API.

This is a Tempo API client library to simplify the interaction with Tempo timesheets. The implementation supports Tempo API v3 and v4.

Pip release is available: https://pypi.org/project/tempo-api-python-client/

Tempo Rest API documentation can be found at https://apidocs.tempo.io/

Installation

Install current release by pip

pip install tempo-api-python-client

Getting Started

You need an API token for communicating with tempo REST APIs.

For v3 use

from tempoapiclient import client_v3

tempo = client_v3.Tempo(
    auth_token="<your_tempo_api_key>",
    )

worklogs = tempo.get_worklogs(
    dateFrom="2019-11-10",
    dateTo="2019-11-11"
    )

for i in worklogs:
    print(i)

For v4 use

from tempoapiclient import client_v4

tempo = client_v4.Tempo(
    auth_token="<your_tempo_api_key>",
    )

Retrieve Worklogs

worklogs = tempo.get_worklogs(
    dateFrom="2019-11-10",
    dateTo="2019-11-11"
    )

for i in worklogs:
    print(i)

There are also functions to retrieve user and team-specific worklogs.

Create Worklog

logged_worklog = tempo.create_worklog(
    accountId="<your_jira_account_id>",
    issueId=12345,
    dateFrom="2019-11-11",
    timeSpentSeconds=3600,
    description="Something",
    startTime="17:00:00"
    attributes=[{_WorkType_: "Development"}]
)

Update Worklog

logged_worklog = tempo.update_worklog(
    id="<id_of_the_worklog_to_be_updated>"  # required
    accountId="<your_jira_account_id>",     # required
    dateFrom="2019-11-11",                  # required
    timeSpentSeconds=3600,                  # required
    description="Something",                # optional
    startTime="17:00:00"                    # optional
)

Delete Worklog

delete_response = tempo.delete_worklog(<worklog_id>)

Code Format

  • Flake8: flake8 --max-line-length=120 tempoapiclient/*

  • Pylint: pylint --max-line-length=120 tempoapiclient

Contributing

Contribution is welcome. See CONTRIBUTING.md for more details.

Release files for tempo-api-python-client 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tempo-api-python-client 0.12.0
File Size Uploaded
tempo_api_python_client-0.12.0.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tempo-api-python-client 0.12.0
File Interpreter ABI Platform
tempo_api_python_client-0.12.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.7 kB

Release files / tempo_api_python_client-0.12.0.tar.gz

Download URL tempo_api_python_client-0.12.0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
04ae196ba4c46609c326e676c06959d665e94b7083a6b0ed7c9899a447723c00
BLAKE2b-256 checksum
How to use checksums
6de2f1201899641b30aec10c31c48d72490fc7dd10ef04373d731d6c2c6915e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / tempo_api_python_client-0.12.0-py3-none-any.whl

Download URL tempo_api_python_client-0.12.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
989569a02bed93b0820f00722c3c8ab3846a1b6a568d24c14b61477320f115cc
BLAKE2b-256 checksum
How to use checksums
bbf07c585a68faafbf0fa5bf12809e2f71a001ea4cf0bc1f19af268e12efb9d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.12.0 This release

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page