Python SDK for the Zoho People API (attendance, timesheet, leave, employees)
Project description
zoho-people-sdk
Python SDK for the Zoho People REST API.
Covers attendance, timesheet, leave management, and employee records — with automatic OAuth token refresh, typed exceptions, and full type hints.
📚 Full documentation: zoho-sdk-people.readthedocs.io
Features
- Attendance — check-in / check-out, bulk import, user reports, shift configuration
- Timesheet — create, submit, approve time logs and timesheet periods
- Leave — apply, approve, cancel leave requests; leave balance report
- Employees — list, search by email / ID, create and update records
- OAuth 2.0 — automatic token refresh,
from_env()helper, multi data-centre support - Typed exceptions —
ZohoPeopleAuthError,ZohoPeoplePermissionError,ZohoPeopleRateLimitError, … - PEP 561 — fully typed,
py.typedmarker included
Installation
pip install zoho-people-sdk
With browser fallback for attendance (when API permissions are unavailable):
pip install "zoho-people-sdk[browser]"
playwright install chromium
Quick Start
from zoho_people import ZohoPeopleAuth, ZohoPeopleClient
# Load credentials from environment variables:
# ZOHO_CLIENT_ID, ZOHO_CLIENT_SECRET, ZOHO_REFRESH_TOKEN, ZOHO_DATA_CENTRE
auth = ZohoPeopleAuth.from_env()
client = ZohoPeopleClient(auth=auth)
# Employees
employees = client.employee.list()
# Add a time log
client.timesheet.add_timelog(
user="mario.rossi@company.com",
work_date="2026-04-25",
hours="08:00",
job_name="My Project",
)
# Pending leave requests
pending = client.leave.get_pending(
from_date="01-Apr-2026",
to_date="30-Apr-2026",
)
# Monthly attendance report
report = client.attendance.get_user_report(
start_date="01/04/2026",
end_date="30/04/2026",
date_format="dd/MM/yyyy",
)
Environment Variables
Copy .env.example to .env:
ZOHO_CLIENT_ID=1000.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ZOHO_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ZOHO_DATA_CENTRE=US # US | EU | IN | AU | JP
ZOHO_REFRESH_TOKEN=1000.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ZOHO_USER_EMAIL=you@company.com
Required OAuth scopes:
ZOHOPEOPLE.forms.ALL,ZOHOPEOPLE.attendance.ALL,ZOHOPEOPLE.timetracker.ALL,ZOHOPEOPLE.leave.ALL
Error Handling
from zoho_people.exceptions import (
ZohoPeopleAuthError,
ZohoPeoplePermissionError,
ZohoPeopleRateLimitError,
ZohoPeopleNotFoundError,
ZohoPeopleValidationError,
ZohoPeopleError,
)
try:
client.timesheet.add_timelog(...)
except ZohoPeoplePermissionError:
print("Missing role permission in Zoho People settings")
except ZohoPeopleAuthError:
print("Invalid or expired OAuth token")
except ZohoPeopleRateLimitError:
print("Rate limit hit — SDK will auto-retry")
except ZohoPeopleError as e:
print(f"API error {e.status_code}: {e.message}")
Data Centres
| Region | Code | Accounts URL |
|---|---|---|
| US | US |
accounts.zoho.com |
| Europe | EU |
accounts.zoho.eu |
| India | IN |
accounts.zoho.in |
| Australia | AU |
accounts.zoho.com.au |
| Japan | JP |
accounts.zoho.jp |
Documentation
Full documentation at zoho-sdk-people.readthedocs.io in English and Italian:
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Install dev dependencies:
pip install -e ".[dev]" - Run tests:
pytest - Lint:
ruff check src/ - Open a pull request
License
MIT © 2026 madyel83
Project details
Release history Release notifications | RSS feed
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 zoho_people_sdk-0.1.0.tar.gz.
File metadata
- Download URL: zoho_people_sdk-0.1.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b607330cdf649842e95adadf51e296c0b5e946ba591b40aa9a478bcf66e8951
|
|
| MD5 |
4dfbf5d86c502313eaca3c29cba192da
|
|
| BLAKE2b-256 |
377cee7ab4809be8ea14c6d38eab93edfda3dc31086eb04bff578c60fafcbfec
|
File details
Details for the file zoho_people_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zoho_people_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4beca643cc44ff6b607f00a7d6889a6018496096ff0dd5723852559e0b19b486
|
|
| MD5 |
2ee3b4ae0986f206abcf93d72d1f4f82
|
|
| BLAKE2b-256 |
757eae914b858737f7d8bd035f87ce83a036a8a6eeb0f63ec76f12f85eed55e9
|