We’re pleased that we’ve released v1.2.0 of the official Nexmo Python library in time for PyCon. Right now it’s a different animal to the PHP library we released last week which is based on the Nexmo client library specification. The Python library presently offers a simpler wrapper around the HTTP requests required to interact with the Nexmo API, but we plan to update it to align with the client library spec in the near future. What do you think?
The purpose of this post is to let you know that we now have an official Python library and – most importantly – to ask for your feedback on the approach we’re taking.
Basic Nexmo Python Library Usage
Usage is really simple. Start with installation:
1 2 |
pip install nexmo |
Then create a new Nexmo Client
instance and call the relevant function:
1 2 3 4 5 6 7 8 9 |
import nexmo client = nexmo.Client(key='KEY', secret='SECRET') response = client.send_message( { 'from': 'Python', 'to': 'YOUR-NUMBER', 'text': 'Hello PyCon' }) |
From there, we’d love you to investigate the Nexmo platform functionality it exposes. For example:
- Provisioning numbers
- Sending SMS
- Making calls using text to speech
- Integrating simple two-factor auth using the Nexmo Verify API
- and much more
Then, take a look at the proposed client library specification and let us know what you think of that as a direction for the Python library. If you prefer email you can always drop a note to devrel@nexmo.com with your thoughts.
In return we’ll send you some Nexmo swag.
Thanks to Tim Craft
Last, but certainly not least, this library has been developed by Tim Craft. He kindly agreed to transfer ownership over to Nexmo recently so that we can make it the officially support Python Nexmo client library. We’re also very pleased to say that Tim will continue contributing.
