An asynchronous Twilio client
Using a virtual environment is recommended for installing this package. Once the virtual environment is created and activated install the package with:
pip install twilio-python-async
When creating a client the twilio account sid and token can either be read from a TWILIO_ACCOUNT_SID
and TWILIO_AUTH_TOKEN
variables, or passed into the client at creation. Using environment variables
is recommended. Examples below will assume the use of environment variables.
Messages can be sent by either using a Twilio messaging service sid, or by passing a from_
phone
number. The messaging service sid can be read from a TWILIO_MESSAGING_SERVICE_SID
environment
variable. The examples below assumes the use of the environment variable.
from twilio_async import AsyncClient
async with AsyncClient() as client:
await client.message_create("My message", "+12068675309")
from twilio_async import AsyncClient
async with AsyncClient() as client:
response = await client.get_message_logs()
Contributions to this project are welcome. If you are interested in contributing please see our contributing guide