Skip to main content

Async Python client for the Timebutler API

Project description

timebutler_client

Async Python client for the Timebutler API (official docs).

[!IMPORTANT] This is NOT an official client by Timebutler GmbH, just a community project.

License: MIT Python Versions (officially) supported Pypi status badge Unittests status badge Coverage status badge Linting status badge Formatting status badge

Installation

pip install timebutler-client

Usage

from timebutler_client import TimebutlerClient

# Create client with your API key
client = TimebutlerClient(api_key="your-api-key")

# Fetch absences for a specific year
absences = await client.get_absences(year=2026)

for absence in absences:
    print(f"{absence.employee_number}: {absence.from_date} - {absence.to_date} ({absence.absence_type})")

Features

[!NOTE] We only implemented a subset of the Timebutler API endpoints, because the API is not very convenient to develop against (no OpenAPI, no sandbox or test system, only admin API keys).

  • Async HTTP client using aiohttp
  • Typed responses using Pydantic models
  • Strict date parsing (European dd/mm/yyyy format)
  • Employee number handling with leading zeros preserved

Supported Endpoints

Method Description
get_absences(year) Fetch absences for a given year
get_projects() Fetch all projects
get_services() Fetch all services
get_worktime(year?, month?, user_id?) Fetch worktime entries with optional filters

Example: Tracking Time by Project

from timebutler_client import TimebutlerClient

client = TimebutlerClient(api_key="your-api-key")

# Get all projects and worktime entries
projects = await client.get_projects()
worktime = await client.get_worktime(year=2026, month=1)

# Build a project name lookup
project_names = {p.id: p.name_stripped for p in projects}

# Sum hours by project
for entry in worktime:
    if entry.has_project:
        project_name = project_names.get(entry.project_id, "Unknown")
        print(f"{entry.date}: {entry.duration} on {project_name}")

Development

This project is based on the Hochfrequenz Python Template Repository. Refer to that repository for detailed setup instructions including tox configuration and IDE setup.

Quick Start

# Create dev environment
tox -e dev

# Run tests
tox -e tests

# Run linting
tox -e linting

# Run type checking
tox -e type_check

License

MIT

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

timebutler_client-0.0.3.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

timebutler_client-0.0.3-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file timebutler_client-0.0.3.tar.gz.

File metadata

  • Download URL: timebutler_client-0.0.3.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for timebutler_client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f1e071ee8bc8d7762ca504ae60f81dff633d5d366bd9e461606961b34539172c
MD5 fe842b5761ac9179ff1b1d740c2cbc96
BLAKE2b-256 8cc827995f1e9ec3a144504dcc551dd2706d594802d2c0666d9ef0a8a5d2ed23

See more details on using hashes here.

Provenance

The following attestation bundles were made for timebutler_client-0.0.3.tar.gz:

Publisher: python-publish.yml on Hochfrequenz/timebutler_client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file timebutler_client-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for timebutler_client-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 575dde3aaa5947ca767bff2689aabefbad2979ca3f9fc8e16f41171665e190c7
MD5 a00ac8d8f90dde9a6f3764099ed45953
BLAKE2b-256 97cc82ead0123c36395550d3b5222128771409a348522cf0e02290c796ca5560

See more details on using hashes here.

Provenance

The following attestation bundles were made for timebutler_client-0.0.3-py3-none-any.whl:

Publisher: python-publish.yml on Hochfrequenz/timebutler_client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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