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.
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/yyyyformat) - 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_users() |
Fetch all users |
get_workdays() |
Fetch workday schedules for all users (see note below) |
get_worktime(year?, month?, user_id?) |
Fetch worktime entries with optional filters |
[!NOTE]
get_workdays()returns aWorkdaysResultwith two named fields:schedulesandinvalid_employees.invalid_employeescontains users whoseemployee_numberfield in Timebutler is empty or non-numeric. This is expected — it occurs for DC users on test systems and for new employees who are not yet fully set up in production. Because employee numbers are mandatory for downstream processing, these users are filtered out here rather than propagating incomplete data further along the pipeline.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timebutler_client-0.0.4.tar.gz.
File metadata
- Download URL: timebutler_client-0.0.4.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f5400fded1e9f46f4211929ac8fac75a740e35cc6d791046e854eb524c4036a
|
|
| MD5 |
4d3559824ea53510b68ada01f4f57a7a
|
|
| BLAKE2b-256 |
42157fcfb2a03a8badf93ec6e4906eabf46836912b3454197d00b0235f935027
|
Provenance
The following attestation bundles were made for timebutler_client-0.0.4.tar.gz:
Publisher:
python-publish.yml on Hochfrequenz/timebutler_client.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timebutler_client-0.0.4.tar.gz -
Subject digest:
4f5400fded1e9f46f4211929ac8fac75a740e35cc6d791046e854eb524c4036a - Sigstore transparency entry: 1399458735
- Sigstore integration time:
-
Permalink:
Hochfrequenz/timebutler_client.py@b9b3ab84e45c236b51db68ad5f373b7b4228d525 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/Hochfrequenz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b9b3ab84e45c236b51db68ad5f373b7b4228d525 -
Trigger Event:
release
-
Statement type:
File details
Details for the file timebutler_client-0.0.4-py3-none-any.whl.
File metadata
- Download URL: timebutler_client-0.0.4-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1ba2ab1013eb762054affa18716dace95d425ed0f1c729cd0bae28e8759371a
|
|
| MD5 |
7e9e7cb3ba3ec69b5f6df28580691fa2
|
|
| BLAKE2b-256 |
f842419cc6865d8d98e223c21dde631ea1adefc13fce16d4a75533a7b25889db
|
Provenance
The following attestation bundles were made for timebutler_client-0.0.4-py3-none-any.whl:
Publisher:
python-publish.yml on Hochfrequenz/timebutler_client.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timebutler_client-0.0.4-py3-none-any.whl -
Subject digest:
b1ba2ab1013eb762054affa18716dace95d425ed0f1c729cd0bae28e8759371a - Sigstore transparency entry: 1399458744
- Sigstore integration time:
-
Permalink:
Hochfrequenz/timebutler_client.py@b9b3ab84e45c236b51db68ad5f373b7b4228d525 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/Hochfrequenz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b9b3ab84e45c236b51db68ad5f373b7b4228d525 -
Trigger Event:
release
-
Statement type: