Python SDK for the jambonz CPaaS platform
Project description
jambonz SDK for Python
A Python SDK for the jambonz open-source CPaaS platform. Build voice applications, manage telephony infrastructure, and control calls programmatically.
Install
pip install jambonz-sdk
Quick start
Environment variables
Create a .env file or set these environment variables:
JAMBONZ_ACCOUNT_SID=your-account-sid
JAMBONZ_API_KEY=your-api-key
The SDK reads them automatically. Get your credentials from the jambonz portal.
REST API client
import asyncio
from jambonz import AsyncJambonzClient
async def main():
async with AsyncJambonzClient() as client:
# List phone numbers
for number in await client.phone_numbers.list():
print(number.number)
# List carriers and their gateways
for carrier in await client.carriers.list():
gateways = await client.gateways.list(voip_carrier_sid=carrier.voip_carrier_sid)
for gw in gateways:
print(f" {gw.ipv4}:{gw.port}")
# Recent call history
for call in await client.recent_calls.list(days=7):
print(f"{call.from_} -> {call.to} ({call.duration}s)")
asyncio.run(main())
Webhook response
Build call flow instructions for incoming calls:
from fastapi import FastAPI
from jambonz import CallWebhook, GatherResult, JambonzResponse, Say, Gather, Hangup, Input
app = FastAPI()
@app.post("/incoming-call")
def handle_call(call: CallWebhook) -> JambonzResponse:
return [
Say(text="Hello! Please say something."),
Gather(input=[Input.SPEECH], action_hook="/handle-speech"),
]
@app.post("/handle-speech")
def handle_speech(result: GatherResult) -> JambonzResponse:
return [
Say(text=f"You said: {result.transcript}. Goodbye!"),
Hangup(),
]
Features
- REST API client with sync and async support
- Typed models for all jambonz resources (Pydantic v2)
- Webhook response builder with typed verbs (Say, Gather, LLM, Dial...)
- Webhook incoming models for parsing call events, gather results, tool calls
- Framework agnostic — works with FastAPI, Flask, Django
- Auto-config from environment variables and
.envfiles - Retry with backoff on rate limits and server errors
- Typed exceptions for clean error handling
Resources
| Resource | Usage |
|---|---|
client.accounts |
Account management |
client.users |
User management |
client.api_keys |
API key management |
client.carriers |
VoIP carriers (Telnyx, Twilio, etc.) |
client.gateways |
SIP gateways |
client.phone_numbers |
Phone number provisioning |
client.applications |
Application configuration |
client.speech_services |
Speech credentials (Google, AWS, ElevenLabs...) |
client.calls |
Active call control (create, update, hangup) |
client.recent_calls |
Call history |
Documentation
Full docs at javiersanchezcastro.github.io/jambonz-sdk
License
MIT
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 jambonz_sdk-0.1.1.tar.gz.
File metadata
- Download URL: jambonz_sdk-0.1.1.tar.gz
- Upload date:
- Size: 10.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98914ecaa487001c10271eb5e49cd5daa2bab50561e463d84ccaa0f2a9a11d4e
|
|
| MD5 |
763dbaf7ee3548f0cb67afa906e9e135
|
|
| BLAKE2b-256 |
25b3b77107ab274262a717bae14ceaead7821fbf653bba6a9a31c8cc169042ee
|
File details
Details for the file jambonz_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: jambonz_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77ff57205a6340139d0ed1c3ba10ac795781dedca16025c63c86e674fb9eb208
|
|
| MD5 |
4328f4ad6037202375b8535f3efbdbb0
|
|
| BLAKE2b-256 |
b6ff58defd4e64ada1906559832e59fefa17b35b76345a9b8f36f8b51cf71709
|