On-Call Compensation Calculator
This tool calculates compensation for on-call shifts based on data from OpsGenie API or CSV files, following specific compensation rules for different time periods and special cases.
Features
- Calculate on-call compensation with standard rates (5.56 € per hour outside working hours)
- Apply special rates for weekend short shifts (< 5 hours: 27.80 €) and night shifts (< 2 hours: 11.12 €)
- Consider individual working hours, time zones, and holidays
- Handle daylight saving time transitions
- Generate detailed reports and compensation summaries
- Create visualizations of daily compensation amounts
- 24.12. + 31.12 are considered 1/2 a workday, unless the downloaded Calendar data suggest a holiday.
- Creates an XSLX File if requested
--export-excel - Has a separate module for check for 24x7 compliance:
uv run ./check_oncall_rules.py shifts.csv - Custom Holidays per user (in user_profiles.json) are supported:
"country_code": "AT",
"custom_holidays": [
"2024-06-16",
"2024-10-31",
"2024-12-13"
]
Installation
- Make sure you have Python 3.12 or later installed
- Clone this repository
- Install dependencies:
git clone https://github.com/pyveci/minuto.git
cd minuto
uv venv --python 3.12 --seed .venv
source .venv/bin/activate
uv pip install -e .
uv pip install build
Configuration
Environment Variables
You can configure the tool using environment variables in a .env file:
# OpsGenie API configuration
OPSGENIE_API_TOKEN=your-api-token-here
OPSGENIE_SCHEDULE_ID=your-schedule-id-here
OPSGENIE_START_DATE=2025-01-01
OPSGENIE_END_DATE=2025-05-09
# File paths
OPSGENIE_CSV_FILE=shifts.csv
OPSGENIE_USER_PROFILES=user_profiles.json
OPSGENIE_OUTPUT_PLOT=compensation_chart.png
OPSGENIE_SAVE_CSV=shifts.csv
User Profiles
User profiles are stored in a JSON file and contain information about:
- User's email
- Time zone
- Working days (0-6, where 0 is Monday)
- Working hours
- Country and region for holiday calculation
- Custom holidays
Usage
The tool provides these main commands:
1. Fetch Data from OpsGenie API
Retrieve on-call shift data directly from the OpsGenie API:
uv run main.py opsgenie --api-token YOUR_TOKEN --schedule-id YOUR_SCHEDULE_ID \
--start-date 2025-01-01 --end-date 2025-05-09 \
--save-csv shifts.csv --user-profiles profiles.json
Or using environment variables:
# After setting up your .env file
uv run main.py opsgenie
2. Process Data from CSV File
If you already have on-call data in a CSV file:
uv run main.py csv shifts.csv --user-profiles profiles.json --output-plot compensation_chart.png
3. Create User Profiles
Generate default user profiles from existing on-call data:
uv run main.py profiles shifts.csv --output user_profiles.json
4. Download Holiday Calendars
Download holiday calendars for specific countries:
uv run main.py calendars --country AT --country FR --country ES --country BG
You can also download all supported calendars at once:
uv run main.py calendars --all
Workflow Examples
Full Workflow with OpsGenie API
- Fetch data from OpsGenie and save to CSV:
uv run main.py opsgenie \
--api-token YOUR_TOKEN \
--schedule-id YOUR_SCHEDULE_ID \
--start-date 2025-01-01 \
--end-date 2025-05-09 \
--save-csv shifts.csv
- Generate user profiles:
uv run main.py profiles shifts.csv --output user_profiles.json
-
Edit the user profiles to adjust timezones, working hours, etc.
-
Calculate compensation with the updated profiles:
uv run main.py csv shifts.csv --user-profiles user_profiles.json --output-plot chart.png
Using Environment Variables
- Create a
.envfile with your configuration:
OPSGENIE_API_TOKEN=your-token
OPSGENIE_SCHEDULE_ID=your-schedule-id
OPSGENIE_START_DATE=2025-01-01
OPSGENIE_END_DATE=2025-05-09
OPSGENIE_SAVE_CSV=shifts.csv
- Fetch data and save to CSV:
uv run main.py opsgenie
- Create and adjust user profiles:
uv run main.py profiles shifts.csv
# Edit user_profiles.json to adjust settings
- Run the compensation calculation:
uv run main.py csv shifts.csv
Report Format
The tool generates a detailed compensation report showing:
=== DAILY COMPENSATION SUMMARY ===
User StartDay StartDate Start EndDate End Hours Amount (€) Pauschale
...
=== USER TOTALS ===
User Total Hours Total Amount (€)
...
=== GRAND TOTAL ===
Total compensation amount: XXX.XX €
CSV Format
The CSV file should have the following columns:
start: Start time of the shift (ISO 8601 format)end: End time of the shift (ISO 8601 format)hours: Duration of the shift in hoursuser: Email of the user who was on call
Metadata
Release files for minuto 0.0.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 |
|---|---|---|---|---|
| minuto-0.0.0.tar.gz | 24.9 kB | Without provenance | Details for minuto-0.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| minuto-0.0.0-py3-none-any.whl | Python 3 | none | any | Details for minuto-0.0.0-py3-none-any.whl |
Total release size: 48.8 kB
Release files / minuto-0.0.0.tar.gz
| Download URL | minuto-0.0.0.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c93de67e2b6d2ffbca28ab015c3d0f31b63dd551c2bfbf568125b4e0b89143f
|
|
BLAKE2b-256 checksum How to use checksums |
52cb78cdd42b722ef2b3416660c5168fa3053ed4fa3360b9bc8f5a3aa041976c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / minuto-0.0.0-py3-none-any.whl
| Download URL | minuto-0.0.0-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1101f39476f6cb0da202a8768cc68d7690093622af97b58d0afcdf0af80fb8d1
|
|
BLAKE2b-256 checksum How to use checksums |
508239d8fd3a38fd9e365d599eea09ca7c6fac80918d9ff08bfc28467ed543c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for minuto 0.0.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.