A modern, asynchronous, and type-safe Python SDK for the Zoho Projects API V3.
Project description
Zoho Projects SDK
A modern, asynchronous, and type-safe Python SDK for the Zoho Projects API V3.
⚠️ Project status: Active development.
Table of Contents
- Overview
- Highlights
- Installation
- Configuration
- Quick Start
- Usage Examples
- Architecture
- Implemented API Modules
- Error Handling & Logging
- Development Workflow
- Testing Strategy
- Contributing
- Support & Resources
- License
Overview
zoho-projects-sdk wraps the Zoho Projects API with an async-first interface that manages authentication, retries, and data validation for you. The SDK is built on top of httpx, tenacity, and Pydantic V2, giving you a strongly typed client that integrates naturally into modern Python applications.
Highlights
- Async by default: Every API call is asynchronous to keep your applications responsive under heavy I/O loads.
- OAuth2 made simple: Automatic access-token refresh handled via
ZohoOAuth2Handlerwith environment-driven configuration. - Strong typing everywhere: Responses map to Pydantic models so you get IDE autocomplete and runtime validation for free.
- Resilient networking: Built-in retries with exponential backoff for transient HTTP errors thanks to
tenacityintegration. - Extensible surface: Resource-specific service classes (projects, tasks, timelogs, etc.) keep the codebase modular and easy to extend.
Installation
Requires Python 3.9+.
pip install zoho-projects-sdk
Or with uv:
uv pip install zoho-projects-sdk
Configuration
The SDK reads credentials from environment variables (directly or via .env).
# .env
ZOHO_PROJECTS_CLIENT_ID="your_client_id"
ZOHO_PROJECTS_CLIENT_SECRET="your_client_secret"
ZOHO_PROJECTS_REFRESH_TOKEN="your_refresh_token"
ZOHO_PROJECTS_PORTAL_ID="your_portal_id"
You can also pass credentials explicitly when instantiating ZohoProjects:
from zoho_projects_sdk.client import ZohoProjects
client = ZohoProjects(
client_id="...",
client_secret="...",
refresh_token="...",
portal_id="...",
)
Quick Start
import asyncio
from zoho_projects_sdk.client import ZohoProjects
async def main() -> None:
async with ZohoProjects() as client:
projects = await client.projects.get_all()
for project in projects:
print(project.name)
if __name__ == "__main__":
asyncio.run(main())
The async context manager ensures the underlying HTTP connection pool is closed cleanly when you are done.
Usage Examples
Fetch a single project
project = await client.projects.get(project_id=123456789)
print(project.id, project.status)
Create a project
from zoho_projects_sdk.models.project_models import Project
new_project = Project(
name="SDK Launch",
description="Ship the SDK to production",
)
created = await client.projects.create(new_project)
print(created.id)
Update existing data
updated = await client.projects.update(project_id=created.id, project_data=new_project)
print(updated.updated_time)
Timelog queries with filters
entries = await client.timelogs.get_by_user(user_id=987654321, from_date="2024-01-01", to_date="2024-01-31")
total_hours = sum(entry.hours for entry in entries)
print(total_hours)
Explore the
timelogs,tasks,issues, and other service modules for more endpoint-specific helpers. They follow the same async pattern documented above.
Ready-to-run scripts
examples/basic_usage.py– list projects and optionally the first project's tasks using an async workflow.examples/timelog_report.py– aggregate billable vs. non-billable hours for a project across a date range.examples/issue_management.py– list recent issues and optionally create/update/delete a sample issue for demonstration purposes.
Architecture
graph TD
subgraph User Application
A[Your App]
end
subgraph zoho-projects-sdk
B[ApiClient]
C[API Modules]
D[Pydantic Models]
E[ZohoOAuth2Handler]
F[Custom Exceptions]
G[Configuration]
end
subgraph External
H[Zoho Projects API]
I[.env file]
end
A --> B
B -- Uses --> E
B -- Makes Calls To --> C
C -- Interacts with --> H
C -- Parses to/from --> D
B -- Raises --> F
E -- Raises --> F
G -- Reads from --> I
E -- Uses Config from --> G
Key components:
ZohoProjectsclient: User-facing façade exposing resource-specific services.ApiClient: Internal HTTP wrapper providing retry logic, default headers, and auth injection.ZohoOAuth2Handler: Refreshes tokens and handles credential loading.models/: Pydantic schemas for the Zoho Projects domain.api/: One module per resource grouping, each delegating network concerns toApiClient.exceptions.py: Rich error metadata for diagnosing failures.utils/logger.py: Centralized logging setup for consistent formatting.@src/zoho_projects_sdk/utils/logger.py#1-36
Implemented API Modules
The following resource modules are currently available (more coming soon):
- Attachments
- Baselines
- Business Hours
- Clients
- Comments
- Contacts
- Events
- Issues
- Milestones
- Phases
- Portals
- Projects
- Roles
- Tags
- Tasklists
- Tasks
- Timelogs
- Users
See src/zoho_projects_sdk/api for endpoint-level details.
Error Handling & Logging
- API failures raise
APIErrorwith status details and payload context. - Network-level problems (timeouts, connectivity, rate limits) are retried automatically up to three times with exponential backoff before surfacing.
- Configure logging via
zoho_projects_sdk.utils.get_loggerto feed SDK logs into your existing observability pipeline.
Development Workflow
-
Clone the repository:
git clone https://github.com/carlospaiva/zoho-projects-sdk.git cd zoho-projects-sdk
-
Install dependencies (production + development):
uv pip install -e .[dev]
-
Keep code formatted and linted:
uv run format uv run lint uv run type-check
-
Run the aggregated quality gate:
uv run check
Testing Strategy
We target 100% line and branch coverage across unit, integration, and end-to-end suites.
-
Run everything:
uv run test
-
Unit tests only:
uv run pytest tests/unit
-
Integration tests (requires live credentials):
uv run pytest tests/integration
Integration suites expect a populated .env so they can hit the live Zoho Projects API responsibly.
Contributing
We welcome issues and pull requests. Please:
- Follow the Conventional Commits specification for commit messages.
- Ensure
uv run checkanduv run testboth pass before opening a PR. - Include tests and documentation updates covering your changes.
- Provide clear reproduction steps when reporting bugs.
Support & Resources
- Examples — start with
basic_usage.py - Issue tracker
For security-sensitive disclosures, please use responsible reporting practices rather than filing a public issue.
License
Distributed under the MIT License. See LICENSE for details.
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_projects_sdk-0.1.5.tar.gz.
File metadata
- Download URL: zoho_projects_sdk-0.1.5.tar.gz
- Upload date:
- Size: 158.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fcbfd260927128e786284abc31bcc6c70420ecdbd50bf026603695bca2aa6a2
|
|
| MD5 |
3e5fd1a68d8462ea43d76bcc447a5734
|
|
| BLAKE2b-256 |
0dff53af323968e8535e8cc0b88c62f59b3f1a771d91e0ce166a853d42bbc603
|
File details
Details for the file zoho_projects_sdk-0.1.5-py3-none-any.whl.
File metadata
- Download URL: zoho_projects_sdk-0.1.5-py3-none-any.whl
- Upload date:
- Size: 50.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
578776a68eb7a757e5a90a523924891078b63f2e911ac9d331df16a9a103c178
|
|
| MD5 |
c0e5e8bd15bfc4b483e59b4b41c3595d
|
|
| BLAKE2b-256 |
402a7a6852e724b7652d30f5f8b80ae93029b597f48a0d81bb91ea51f50ca985
|