Skip to main content

Python API Wrapper for the CallHub API

Project description

CallHub Python Wrapper

Build Status Coverage Status PyPI version

CallHub API Client Wrapper for Python

Creates a clean(er) python interface to several important functions of the CallHub API.

project-logo

Installation

pip install callhub-python-wrapper

Requires Python 3.5 or higher

Features

  • Built-in (optional) ratelimiting that respects CallHub's varying rate limits for different functions
  • Better error handling for uploading contacts with fields that don't exist in CallHub
  • Abstracted away some tedious parts of using CallHub's API. When uploading contacts, CallHub wants you to map CSV columns to the ids of each field in CallHub, which is difficult and easy to mess up. This wrapper handles all of that by matching on field names.
  • Automatically handles paging when doing bulk fetching
  • Uses async requests to improve speed for repetitive calls (implemented in get_contacts)

Currently implemented

  • Bulk create contacts
  • Get agent leaderboard
  • Get all fields and IDs (including custom fields)
  • Bulk get contacts and fields
  • Create single contact

Currently on roadmap

  • Create phonebook
  • Add/delete/get contacts to/from DNC list
  • Create/get/delete webhook
  • Create/get teams
  • Add/delete agent to/from team
  • Create/delete agent

Usage

import callhub
callhub = CallHub(api_key="123456789ABCDEF")
phonebook_id = 6545324
contacts = [{'first name': 'Sumiya', 'phone number':'5555555555', 'mobile number': '5555555555'},
           {'first name': 'Joe', 'phone number':'5555555555', 'mobile number':'5555555555'}]
country_iso = "CA"

# Create multiple contacts
callhub.bulk_create(phonebook_id, contacts, country_iso)

# Create single contact
callhub.create_contact(contacts[0])

# Get all contacts (up to a user-specified limit)
callhub.get_contacts(1000000)

Project details


Download files

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

Source Distribution

callhub-python-wrapper-0.1.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

callhub_python_wrapper-0.1.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file callhub-python-wrapper-0.1.2.tar.gz.

File metadata

  • Download URL: callhub-python-wrapper-0.1.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

File hashes

Hashes for callhub-python-wrapper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a79757c8a7817fb3bdc1d533ad27f6e6f3a0df6b21393063308ceb982e0f50e8
MD5 ec8e7a0bda0d13da4b23df1de38c511d
BLAKE2b-256 9646b704e62383b8ea549c6687108b67993c6110c1f4219b8f70c8feed5a65fc

See more details on using hashes here.

File details

Details for the file callhub_python_wrapper-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: callhub_python_wrapper-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

File hashes

Hashes for callhub_python_wrapper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb3f29c673ee2a29591e0045689c146f38c68049c0753b1097e2e057742c097
MD5 fec5937583b2f6018ec47a22e1df8395
BLAKE2b-256 796d29d603c55de11a9e9984687c14fcb625380182a06d4395cafe9937be3a94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page