Skip to main content

An asynchronous Twilio client

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twilio_python_async-0.2.3.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

twilio_python_async-0.2.3-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page