Installation | Usage | Examples | License
This is the Python client library for Nexmo's API. To use it you'll need a Nexmo account. Sign up for free at nexmo.com.
To install the Python client library using pip:
$ pip install nexmo
Alternatively you can clone the repo or download the source.
Specify your credentials using the NEXMO_API_KEY and NEXMO_API_SECRET
environment variables; import the nexmo package; and construct a client object.
For example:
import nexmo
client = nexmo.Client()Alternatively you can specify your credentials directly using the key
and secret keyword args:
import nexmo
client = nexmo.Client(key='YOUR-API-KEY', secret='YOUR-API-SECRET')Use Nexmo's SMS API to send an SMS message.
Call the send_message method with a dictionary containing the message parameters. For example:
import nexmo
client = nexmo.Client(key='YOUR-API-KEY', secret='YOUR-API-SECRET')
client.send_message({'from': 'Python', 'to': 'YOUR-NUMBER', 'text': 'Hello world'})This library is released under the MIT License