Skip to main content

Python bindings for Tempo (https://apidocs.tempo.io/)

Project description

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.

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

tempo_api_python_client-0.12.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

tempo_api_python_client-0.12.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file tempo_api_python_client-0.12.0.tar.gz.

File metadata

  • Download URL: tempo_api_python_client-0.12.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for tempo_api_python_client-0.12.0.tar.gz
Algorithm Hash digest
SHA256 04ae196ba4c46609c326e676c06959d665e94b7083a6b0ed7c9899a447723c00
MD5 f0ed48dc3a5fd38d3d524635d6c4da45
BLAKE2b-256 6de2f1201899641b30aec10c31c48d72490fc7dd10ef04373d731d6c2c6915e8

See more details on using hashes here.

File details

Details for the file tempo_api_python_client-0.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tempo_api_python_client-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 989569a02bed93b0820f00722c3c8ab3846a1b6a568d24c14b61477320f115cc
MD5 2dc16a2aa042846628b0967a49c68a9b
BLAKE2b-256 bbf07c585a68faafbf0fa5bf12809e2f71a001ea4cf0bc1f19af268e12efb9d1

See more details on using hashes here.

Supported by

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