SignalWire Python SDK
raw JSON → 2.1.1 verified Mon Apr 27 auth: no python
Official Python client library for the SignalWire telecom platform, providing voice, video, messaging, and task router capabilities. Current version 2.1.1 requires Python >=3.6. Released under MIT license.
pip install signalwire Common errors
error ModuleNotFoundError: No module named 'signalwire.voice' ↓
cause Installed an older version (pre-2.0) that used flat structure.
fix
Upgrade to latest: pip install --upgrade signalwire
error twisted.internet.error.ReactorNotRestartable ↓
cause Calling client.connect() or similar twice in the same process.
fix
Reuse the same client instance across calls, or stop the reactor before restarting.
Warnings
breaking In version 2.0, the package was restructured from flat module to submodules. Old import paths (e.g., from signalwire import Voice) no longer work. ↓
fix Use from signalwire.voice import Voice
gotcha The library requires Twisted as an event loop; it does not work with asyncio out of the box. Running in an asyncio context may block or cause errors. ↓
fix Use Twisted's reactor or run in a separate thread.
deprecated The signalwire.rest submodule for REST API calls is deprecated. Use signalwire.voice or signalwire.messaging methods instead. ↓
fix Use voice.calls.create() or messaging.send() instead of manual REST requests.
Imports
- Voice wrong
from signalwire import Voicecorrectfrom signalwire.voice import Voice - Messaging wrong
from signalwire import Messagingcorrectfrom signalwire.messaging import Messaging - TaskRouter wrong
from signalwire import TaskRoutercorrectfrom signalwire.task_router import TaskRouter
Quickstart
import os
from signalwire.voice import Voice
client = Voice(
project=os.environ.get('SIGNALWIRE_PROJECT', ''),
token=os.environ.get('SIGNALWIRE_TOKEN', '')
)
print(client)