# zoho/zcrm-python-sdk architecture

> Architecture diagram of the GitHub repository zoho/zcrm-python-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zoho/zcrm-python-sdk
- Repository: https://github.com/zoho/zcrm-python-sdk

## Overview

This is a Python client SDK wrapping Zoho CRM APIs. Applications initialize configuration and obtain a REST client, then use its module, record, organization, or metadata-facing objects to request CRM operations; handlers construct API requests, which are authenticated, sent, and decoded into SDK responses. OAuth supports grant/refresh-token flows and token persistence, including the documented file, MySQL, and custom-handler choices. The graph reflects README capabilities and sampled source; some handler-to-request wiring and unsampled capabilities are omitted where direct implementation evidence was unavailable.

Main entry points: [`zcrmsdk/OAuthClient.py`](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/OAuthClient.py) (OAuth client), [`zcrmsdk/RestClient.py`](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/RestClient.py) (REST client), [`zcrmsdk/Handler.py`](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Handler.py) (API handlers), [`zcrmsdk/Request.py`](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Request.py) (CRM HTTP request)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client entry and models"]
  node_rest["REST client<br/>[RestClient.py]"]
  node_config["Configuration<br/>[Utility.py]"]
  node_models["CRM entities<br/>[Operations.py]"]
  node_organization["Organization model<br/>[Org.py]"]
  node_exceptions["Errors and logging<br/>[CLException.py]"]
end

subgraph group_api["CRM API operations"]
  node_handlers["API handlers<br/>[Handler.py]"]
end

subgraph group_auth["OAuth and persistence"]
  node_oauth_client["OAuth client<br/>[OAuthClient.py]"]
  node_oauth_util["OAuth utilities<br/>[OAuthUtility.py]"]
  node_token_store[("Token persistence<br/>[Persistence.py]")]
  node_oauth_request["OAuth HTTP connector<br/>[OAuthUtility.py]"]
end

subgraph group_transport["HTTP transport"]
  node_crm_http["CRM HTTP request<br/>[Request.py]"]
  node_connector["HTTP connector<br/>[Utility.py]"]
  node_response["API responses<br/>[Response.py]"]
end

node_application(("Client application"))
node_crm(("Zoho CRM API"))
node_accounts(("Zoho Accounts"))

node_application -->|"initializes and calls"| node_rest
node_rest -->|"initializes"| node_config
node_rest -->|"dispatches requests"| node_handlers
node_rest -->|"creates models"| node_models
node_rest -->|"creates organization"| node_organization
node_organization -->|"delegates operations"| node_handlers
node_models -->|"dispatches operations"| node_handlers
node_handlers -->|"constructs requests"| node_crm_http
node_crm_http -->|"authenticates request"| node_oauth_client
node_crm_http -->|"sends request"| node_connector
node_connector -->|"sends HTTP"| node_crm
node_crm_http -->|"parses response"| node_response
node_response -->|"returns result"| node_application
node_config -->|"configures"| node_oauth_client
node_application -->|"requests tokens"| node_oauth_client
node_oauth_client -->|"uses OAuth parameters"| node_oauth_util
node_oauth_client -->|"requests tokens"| node_oauth_request
node_oauth_request -->|"sends OAuth request"| node_accounts
node_oauth_client -->|"reads and writes tokens"| node_token_store
node_handlers -->|"logs and raises"| node_exceptions
node_oauth_client -->|"logs and raises"| node_exceptions

click node_rest "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/RestClient.py"
click node_config "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Utility.py"
click node_models "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Operations.py"
click node_organization "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Org.py"
click node_handlers "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Handler.py"
click node_crm_http "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Request.py"
click node_connector "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Utility.py"
click node_response "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Response.py"
click node_oauth_client "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/OAuthClient.py"
click node_oauth_util "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/OAuthUtility.py"
click node_token_store "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Persistence.py"
click node_oauth_request "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/OAuthUtility.py"
click node_exceptions "https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/CLException.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rest,node_config,node_models,node_organization,node_exceptions,node_application toneBlue
class node_handlers toneAmber
class node_oauth_client,node_oauth_util,node_token_store,node_oauth_request,node_crm toneMint
class node_crm_http,node_connector,node_response toneRose
class node_accounts toneIndigo
```

## Components

### Client entry and models

- [REST client](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/RestClient.py): `zcrmsdk/RestClient.py`
- [Configuration](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Utility.py): `zcrmsdk/Utility.py`
- [CRM entities](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Operations.py): `zcrmsdk/Operations.py`
- [Organization model](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Org.py): `zcrmsdk/Org.py`
- [Errors and logging](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/CLException.py): `zcrmsdk/CLException.py`

### CRM API operations

- [API handlers](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Handler.py): `zcrmsdk/Handler.py`

### OAuth and persistence

- [OAuth client](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/OAuthClient.py): `zcrmsdk/OAuthClient.py`
- [OAuth utilities](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/OAuthUtility.py): `zcrmsdk/OAuthUtility.py`
- [Token persistence](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Persistence.py): `zcrmsdk/Persistence.py`
- [OAuth HTTP connector](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/OAuthUtility.py): `zcrmsdk/OAuthUtility.py`

### HTTP transport

- [CRM HTTP request](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Request.py): `zcrmsdk/Request.py`
- [HTTP connector](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Utility.py): `zcrmsdk/Utility.py`
- [API responses](https://github.com/zoho/zcrm-python-sdk/blob/master/zcrmsdk/Response.py): `zcrmsdk/Response.py`

### Other components

- **Client application**
- **Zoho CRM API**
- **Zoho Accounts**

## Connections

- Client application → REST client: initializes and calls
- REST client → Configuration: initializes
- REST client → API handlers: dispatches requests
- REST client → CRM entities: creates models
- REST client → Organization model: creates organization
- Organization model → API handlers: delegates operations
- CRM entities → API handlers: dispatches operations
- API handlers → CRM HTTP request: constructs requests
- CRM HTTP request → OAuth client: authenticates request
- CRM HTTP request → HTTP connector: sends request
- HTTP connector → Zoho CRM API: sends HTTP
- CRM HTTP request → API responses: parses response
- API responses → Client application: returns result
- Configuration → OAuth client: configures
- Client application → OAuth client: requests tokens
- OAuth client → OAuth utilities: uses OAuth parameters
- OAuth client → OAuth HTTP connector: requests tokens
- OAuth HTTP connector → Zoho Accounts: sends OAuth request
- OAuth client → Token persistence: reads and writes tokens
- API handlers → Errors and logging: logs and raises
- OAuth client → Errors and logging: logs and raises
