Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

sanders41/twilio-python-async

Repository files navigation

Asynchronous Twilio Client

Tests Status pre-commit.ci status Coverage PyPI version PyPI - Python Version

An asynchronous Twilio client

⚠️ The official Twilio Python Client now natively supports asyncio so this project had been depreciated.

Installation

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

Useage

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.

Send an SMS message

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")

Retrieve message logs

from twilio_async import AsyncClient


async with AsyncClient() as client:
    response = await client.get_message_logs()

Contributing

Contributions to this project are welcome. If you are interested in contributing please see our contributing guide

About

An asynchronous Twilio client

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages