A python wrapper for the Dialpad REST API
Project description
Python Dialpad API Client
A python wrapper around the Dialpad REST API
This document describes the installation, usage, and development practices of this python library. For information about the API itself, head on over to our API Documentation page!
Installation
Just use everyone's new favourite python package manager: uv
uv add python-dialpad
Usage
The Short Version
TL;DR, this library provides a DialpadClient class, which can be instantiated with an API token
and a dialpad URL.
Once a DialpadClient object has been constructed, it can be used to call our API endpoints:
from dialpad import DialpadClient
dp_client = DialpadClient(sandbox=True, token='API_TOKEN_HERE')
print(dp_client.users.get(user_id='1234567'))
Client Constructor Arguments
token (required)The API token that will be used to authenticate API requests.sandbox (optional)If thesandboxargument is set toTrue, then API calls will be routed tohttps://sandbox.dialpad.com.base_url (optional)Routes requests to a specific url.
API Resources
In general, resources that we support in our public API will be exposed as properties of the
client object. For example, the User resource can be accessed using the users property (as
demonstrated above).
Each of these resource properties will expose related HTTP methods as methods of that resource property.
For example, GET /api/v2/users/{id} translates to dp_client.users.get('a_user_id').
When in doubt, type annotations and docstrings are sourced directly from the Dialpad API spec, and
should behave well with most editors' autocomplete/tooltip features:
API Responses
In cases where our API responds with a single JSON object, the client method will return a Python dict (as demonstrated above)
In cases where our API responds with a paginated list of many JSON objects, the client method will return an iterator which will lazily request the next page as the iterator is iterated upon.
from dialpad import DialpadClient
dp_client = DialpadClient(sandbox=True, token='API_TOKEN_HERE')
for user in dp_client.users.list():
print(user)
Async Support
AsyncDialpadClient is a thing now 🌈
from dialpad import AsyncDialpadClient
dp_client = AsyncDialpadClient(sandbox=True, token='API_TOKEN_HERE')
async for user in dp_client.users.list():
print(user)
Development
This project is now managed with uv, and exposes a cli tool to automate most maintenance tasks.
uv run cli --help for details.
Maintenance Releases
Changes/additions to the Dialpad API can be handled (mostly) automatically 👍
Update Procedure
- Run
uv run cli interactive-update
This will take care of pulling down the latest OAS from dialpad.com, updating the client accordingly, and bumping the package version number.
-
Run
uv run pytest- Never hurts to confirm that nothing got borked 👍
-
Commit the changes, tag the commit, and push up the changes
interactive-updateprovides these in its output for convenience 👍
Pushing up a version tag will trigger GHA to build, test, and publish to PyPI 🍻
Feature Releases
The schema and resource classes in this project are now automatically-generated, but the rest of the project files can still be directly edited to add features or extend functionality
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 python_dialpad-3.1.0.tar.gz.
File metadata
- Download URL: python_dialpad-3.1.0.tar.gz
- Upload date:
- Size: 354.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f866f6b33ef8960e5112f23817b62ae74d4cb906672b350b54da35c38dbd4b94
|
|
| MD5 |
2055aa4dce1c5989426a9c6a173229f7
|
|
| BLAKE2b-256 |
1f9baebd57566ae35ade04335beaed9e230f4d8a09ff6726a1c1b7cd968bcb19
|
Provenance
The following attestation bundles were made for python_dialpad-3.1.0.tar.gz:
Publisher:
publish.yml on dialpad/dialpad-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_dialpad-3.1.0.tar.gz -
Subject digest:
f866f6b33ef8960e5112f23817b62ae74d4cb906672b350b54da35c38dbd4b94 - Sigstore transparency entry: 237682628
- Sigstore integration time:
-
Permalink:
dialpad/dialpad-python-sdk@bbad9e3abe66a8815d435d1c03df6fa2d2229cd3 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/dialpad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bbad9e3abe66a8815d435d1c03df6fa2d2229cd3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file python_dialpad-3.1.0-py3-none-any.whl.
File metadata
- Download URL: python_dialpad-3.1.0-py3-none-any.whl
- Upload date:
- Size: 143.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a57093d102a40c02e1fd820155276ae6fad46cf713ebf4c7d578c69f3c49ad63
|
|
| MD5 |
17ee33dcd8892fe67e57a59369e86f07
|
|
| BLAKE2b-256 |
2b8a30f72d40dd53fc98b7f53aee0bd2a71ff75b1c836db781d24b0b7279b55c
|
Provenance
The following attestation bundles were made for python_dialpad-3.1.0-py3-none-any.whl:
Publisher:
publish.yml on dialpad/dialpad-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_dialpad-3.1.0-py3-none-any.whl -
Subject digest:
a57093d102a40c02e1fd820155276ae6fad46cf713ebf4c7d578c69f3c49ad63 - Sigstore transparency entry: 237682634
- Sigstore integration time:
-
Permalink:
dialpad/dialpad-python-sdk@bbad9e3abe66a8815d435d1c03df6fa2d2229cd3 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/dialpad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bbad9e3abe66a8815d435d1c03df6fa2d2229cd3 -
Trigger Event:
push
-
Statement type: