personio-api-client
Python client for the Personio REST API.
Installation
pip install personio-api-client
Or with uv:
uv add personio-api-client
Quick Start
from datetime import date
from personio_api_client import PersonioClient
# Using environment variables (recommended)
# Set PERSONIO_CLIENT_ID and PERSONIO_CLIENT_SECRET
with PersonioClient() as client:
# Get all active employees
employees = client.get_employees()
# Get time-offs for a date range
time_offs = client.get_time_offs(
start_date=date(2025, 1, 1),
end_date=date(2025, 12, 31),
)
# Get time-off types
types = client.get_time_off_types()
Configuration
Environment Variables
export PERSONIO_CLIENT_ID="your-client-id"
export PERSONIO_CLIENT_SECRET="your-client-secret"
Explicit Credentials
client = PersonioClient(
client_id="your-client-id",
client_secret="your-client-secret",
)
Options
client = PersonioClient(
client_id="...",
client_secret="...",
base_url="https://api.personio.de/v1", # default
timeout=30.0, # seconds, default
)
API Reference
PersonioClient
get_employees(active_only=True)
Get all employees from Personio.
employees = client.get_employees()
for emp in employees:
print(f"{emp.name} - {emp.department}")
Returns: list[PersonioEmployee]
get_time_offs(start_date=None, end_date=None, employee_ids=None)
Get time-offs (vacation, sick leave, etc.).
from datetime import date
time_offs = client.get_time_offs(
start_date=date(2025, 1, 1),
end_date=date(2025, 12, 31),
)
for t in time_offs:
print(f"{t.employee_name}: {t.time_off_type_name} ({t.start_date} - {t.end_date})")
Returns: list[PersonioTimeOff]
get_time_off_types()
Get all time-off types.
types = client.get_time_off_types()
for t in types:
print(f"{t.name} ({t.category})")
Returns: list[PersonioTimeOffType]
Models
PersonioEmployee
| Field | Type | Description |
|---|---|---|
id |
int |
Employee ID |
email |
str | None |
Email address |
first_name |
str | None |
First name |
last_name |
str | None |
Last name |
status |
str | None |
active, inactive, onboarding |
department |
str | None |
Department name |
team |
str | None |
Team name |
position |
str | None |
Position title |
hire_date |
date | None |
Hire date |
termination_date |
date | None |
Termination date |
weekly_working_hours |
float | None |
Weekly hours |
work_schedule |
PersonioWorkSchedule | None |
Work schedule |
Property: name - Full name or fallback to email/ID
PersonioTimeOff
| Field | Type | Description |
|---|---|---|
id |
int |
Time-off ID |
employee_id |
int |
Employee ID |
employee_email |
str | None |
Employee email |
employee_first_name |
str | None |
Employee first name |
employee_last_name |
str | None |
Employee last name |
time_off_type_id |
int |
Type ID |
time_off_type_name |
str |
Type name |
start_date |
date |
Start date |
end_date |
date |
End date |
days_count |
float |
Number of days |
half_day_start |
bool |
Half day at start |
half_day_end |
bool |
Half day at end |
status |
str |
approved, pending, rejected |
comment |
str | None |
Comment |
Property: employee_name - Full name or fallback
PersonioWorkSchedule
| Field | Type | Description |
|---|---|---|
id |
int |
Schedule ID |
name |
str |
Schedule name |
valid_from |
date | None |
Valid from date |
monday - sunday |
str |
Hours per day (HH:MM format) |
Method: hours_for_weekday(weekday: int) - Get hours for weekday (0=Monday)
Exceptions
PersonioError- Base exceptionPersonioConfigurationError- Missing credentialsPersonioAuthenticationError- Invalid credentials (401)PersonioRateLimitError- Rate limit exceeded (429)
Development
# Clone repository
git clone https://github.com/dkd-dobberkau/personio-api-client
cd personio-api-client
# Install with dev dependencies
uv sync --all-extras
# Run tests
uv run pytest
# Lint
uv run ruff check src/
uv run ruff format src/
License
MIT
Metadata
Release files for personio-api-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| personio_api_client-0.1.0.tar.gz | 8.8 kB | Without provenance | Details for personio_api_client-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| personio_api_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for personio_api_client-0.1.0-py3-none-any.whl |
Total release size: 17.9 kB
Release files / personio_api_client-0.1.0.tar.gz
| Download URL | personio_api_client-0.1.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33c4c0606701b0fbf2d6f9af92d98d6452f37fe8de3d67dea5fddcd660315a9e
|
|
BLAKE2b-256 checksum How to use checksums |
db3f64d638fe071717285b5bd884e7c512f208511b78be2b1eadc8ad09de4157
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.5
|
Release files / personio_api_client-0.1.0-py3-none-any.whl
| Download URL | personio_api_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a05ab6857ffe58947c4e4ac90cb97654f4e08a0386dd1578e8139ae5a26c6e5
|
|
BLAKE2b-256 checksum How to use checksums |
fc5d13b6521559bb4ced4e840b3919490bfe99d7cba5fa7df170918de36c0e9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.5
|
Security for personio-api-client 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.