This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Asynchronous wrapper for Zoho's numerous APIs

Project Description

A python wrapper library for Zoho API calls which aims to unify the API for the different Zoho Products (CRM, Support, Projects etc).

NOTE: Only the crm client is in a production ready state.

The library has asynchronous interface i.e.

from talkzoho import CRMClient


async def main():
    crm     = CRMClient(auth_token='xxx')
    account = await crm.accounts.get('7030050000019540342')

However, Talk Zoho also provides the helper function talkzoho.utils.wait for usage in synchronous code.

from talkzoho import CRMClient
from talkzoho.utils import wait


account = wait(crm.accounts.get, '7030050000019540342')

Installation

pip install talkzoho

Example Usage

from talkzoho import CRMClient


async def main():
    crm = CRMClient(auth_token='xxx')

    # Get Account
    account = await crm.accounts.get('7030050000019540342')

    # Insert Lead
    lead_id = await crm.leads.insert({
        'First Name': 'Bill',
        'Last Name': 'Billson'})

    # Filter Leads
    bills = await crm.leads.filter(term='Bill', limit=1)

    # Update Contact
    contact_id = await crm.contacts.update({
        'CONTACTID': '7030050000019540536',
        'First Name': 'Jill',
        'Last Name': 'Jillson'})

    # Delete Contact
    success = await crm.contacts.delete('7030050000019540536')

Renamed and Custom Modules

Talk Zoho supports renamed standard modules; when initialising the CRMClient pass the flag to indicate if you want to use Zoho’s canonical names or the user’s aliases. The flag (use_module_aliases) defaults to False.

async def main():
    crm = CRMClient(auth_token='xxx', use_module_aliases=False)
    potential = await crm.potentials.get('7030050000019540360')

    crm = CRMClient(auth_token='xxx', use_module_aliases=True)
    opportunity = await crm.opportunities.get('7030050000019540360')
    # potential == opportunity

This works the same for custom modules:

async def main():
    crm = CRMClient(auth_token='xxx', use_module_aliases=False)
    custom_record = await crm.custom_module_8.get('9130050000019540360')

    crm = CRMClient(auth_token='xxx', use_module_aliases=True)
    partner = await crm.partners.get('9130050000019540360')
    # custom_record == partner

Error Handling

Zoho use a number of ways to inform the client of errors. For example, CRM always returns a 200 status code with a error message and code in the body, where as books will return more standard looking HTTP errors. Talk Zoho tries to unify these and raises a `tornado.web.HTTPError <http://www.tornadoweb.org/en/stable/web.html#tornado.web.HTTPError>`__. Talk Zoho will also map the Zoho specific codes to their HTTP status code equivalent.

NOTE: Deleting a CRM record (with a correct-looking id) will never return an error.This is the behavior of Zoho’s CRM API.

from talkzoho import CRMClient
from tornado.web import HTTPError


async def main():
    crm = CRMClient(auth_token='xxx')

    try:
        account = await crm.accounts.get('1234')
    except HTTPError as http_error:
        # HTTPError(404, reason='No record available with the specified record ID.')
        print(http_error)
Release History

Release History

This version
History Node

3.0.3

History Node

3.0.2

History Node

3.0.1

History Node

3.0.0

History Node

2.1.0

History Node

2.0.9

History Node

2.0.8

History Node

2.0.7

History Node

2.0.6

History Node

2.0.5

History Node

2.0.4

History Node

2.0.3

History Node

2.0.2

History Node

2.0.1

History Node

1.0.0

History Node

0.9.8

History Node

0.9.7

History Node

0.9.6

History Node

0.9.5

History Node

0.9.4

History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

History Node

0.8.9

History Node

0.8.8

History Node

0.8.7

History Node

0.8.6

History Node

0.8.5

History Node

0.8.4

History Node

0.8.3

History Node

0.8.2

History Node

0.8.1

History Node

0.7.4

History Node

0.7.3

History Node

0.7.2

History Node

0.7.1

History Node

0.7.0

History Node

0.6.0

History Node

0.5.9

History Node

0.5.8

History Node

0.5.7

History Node

0.5.6

History Node

0.5.5

History Node

0.5.4

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5

History Node

0.4.dev2

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
talkzoho-3.0.3.tar.gz (12.3 kB) Copy SHA256 Checksum SHA256 Source Mar 3, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting