Skip to content

Commit

Permalink
Merge pull request #163 from Vonage/v251-patch
Browse files Browse the repository at this point in the history
2.5.2 Patch
  • Loading branch information
superdiana committed Aug 27, 2020
2 parents dc4b10d + 4a252b4 commit 86ef8a4
Show file tree
Hide file tree
Showing 9 changed files with 598 additions and 86 deletions.
94 changes: 54 additions & 40 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,106 @@
# 2.5.x

- Support for Independent SMS, Voice and Verify APIs with tests as well as current client methods
- Getters/Setters to extract/rewrite custom attributes
- PSD2 Verification support
- Dropping support for Python 2.7
- Roadmap to better error handling
- Supporting Python 3.8

# 2.4.0
* Application V2 API added under `Client.application_v2`
* Existing application methods under `Client` are now deprecated.

- Application V2 API added under `Client.application_v2`
- Existing application methods under `Client` are now deprecated.

# 2.3.0
* Explicit parameter list for the `nexmo.Client` constructor. **This may cause errors in code passing incorrect or spurious arguments to the Client constructor.**
* Secret Management
* Support for Authorization header authentication.

- Explicit parameter list for the `nexmo.Client` constructor. **This may cause errors in code passing incorrect or spurious arguments to the Client constructor.**
- Secret Management
- Support for Authorization header authentication.

# 2.2.0
* Add support for `redact_transaction`.

- Add support for `redact_transaction`.

# 2.1.0
* Add support for `get_recording`
* Add support for SMS conversion
* Add debug logging for most calls, under the 'nexmo' logger.
* Internal refactoring (affects only private methods.)

- Add support for `get_recording`
- Add support for SMS conversion
- Add debug logging for most calls, under the 'nexmo' logger.
- Internal refactoring (affects only private methods.)

# 2.0.0
* Drop support for Python 3.3 (in line with the cryptography library we depend upon)
* Ensure timestamp is added the params list if signing requests
* Avoid value injection in signature auth.
* Add support for different hashes for signature generation (thanks @trancee!)
* Tests ported to pytest

- Drop support for Python 3.3 (in line with the cryptography library we depend upon)
- Ensure timestamp is added the params list if signing requests
- Avoid value injection in signature auth.
- Add support for different hashes for signature generation (thanks @trancee!)
- Tests ported to pytest

# 1.5.0

* Add ability to provide a file path as private_key param no the nexmo.Client constructor
- Add ability to provide a file path as private_key param no the nexmo.Client constructor

* Add send/stop endpoints for audio/speech/dtmf
- Add send/stop endpoints for audio/speech/dtmf

* Add new number insight endpoints
- Add new number insight endpoints

# 1.4.0

* Add new Voice API call methods
- Add new Voice API call methods

* Add Application API methods
- Add Application API methods

* Add check_signature method for checking callback signatures
- Add check_signature method for checking callback signatures

* Deprecate old Verify API methods
- Deprecate old Verify API methods

# 1.3.0

* Add get_sms_pricing method
- Add get_sms_pricing method

* Add get_voice_pricing method
- Add get_voice_pricing method

* Add get_event_alert_numbers method to get opt-in/opt-out numbers
- Add get_event_alert_numbers method to get opt-in/opt-out numbers

* Add resubscribe_event_alert_number method to opt-in a number
- Add resubscribe_event_alert_number method to opt-in a number

* Add more clearly named methods for Verify API
- Add more clearly named methods for Verify API

* Add app_name and app_version options
- Add app_name and app_version options

# 1.2.0

* Add topup method
- Add topup method

* Add update_settings method
- Add update_settings method

* Add api_host attribute
- Add api_host attribute

* Add ClientError and ServerError classes
- Add ClientError and ServerError classes

# 1.1.0

* Move repository to https://github.com/Nexmo/nexmo-python
- Move repository to https://github.com/Nexmo/nexmo-python

* Add get_basic_number_insight method for Number Insight Basic API
- Add get_basic_number_insight method for Number Insight Basic API

* Add get_number_insight method for Number Insight Standard API
- Add get_number_insight method for Number Insight Standard API

* Add User-Agent header to requests
- Add User-Agent header to requests

# 1.0.3

* Change license from LGPL-3.0 to MIT
- Change license from LGPL-3.0 to MIT

# 1.0.2

* Remove merge helper function
- Remove merge helper function

# 1.0.1

* Python 3.x fixes
- Python 3.x fixes

# 1.0.0

* First version!
- First version!
70 changes: 32 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
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][signup].


* [Installation](#installation)
* [Usage](#usage)
* [SMS API](#sms-api)
Expand All @@ -23,7 +22,6 @@ need a Nexmo account. Sign up [for free at nexmo.com][signup].
* [Frequently Asked Questions](#frequently-asked-questions)
* [License](#license)


## Installation

To install the Python client library using pip:
Expand Down Expand Up @@ -86,7 +84,7 @@ from nexmo import Sms
from nexmo.sms import Sms

#Option 3
import nexmo #then tou can use nexmo.Sms() to create an instance
import nexmo #then you can use nexmo.Sms() to create an instance
```

- Create an instance
Expand Down Expand Up @@ -141,7 +139,6 @@ sms.submit_sms_conversion(response['message-id'])

### Make a call


```python
from nexmo import Client, Voice
client = Client(application_id=APPLICATION_ID, private_key=PRIVATE_KEY)
Expand All @@ -162,18 +159,15 @@ voice = Voice(client)
voice.get_calls()
```


### Retrieve a single call


```python
from nexmo import Client, Voice
client = Client(application_id=APPLICATION_ID, private_key=PRIVATE_KEY)
voice = Voice(client)
voice.get_call(uuid)
```


### Update a call

```python
Expand All @@ -188,7 +182,6 @@ response = voice.create_all({
voice.update_call(response['uuid'], action='hangup')
```


### Stream audio to a call

```python
Expand All @@ -204,7 +197,6 @@ response = voice.create_call({
voice.send_audio(response['uuid'],stream_url=[stream_url])
```


### Stop streaming audio to a call

```python
Expand All @@ -221,7 +213,6 @@ voice.send_audio(response['uuid'],stream_url=[stream_url])
voice.stop_audio(response['uuid'])
```


### Send a synthesized speech message to a call

```python
Expand Down Expand Up @@ -253,7 +244,6 @@ voice.send_speech(response['uuid'], text='Hello from nexmo')

### Send DTMF tones to a call


```python
from nexmo import Client, Voice
client = Client(application_id=APPLICATION_ID, private_key=PRIVATE_KEY)
Expand All @@ -272,26 +262,30 @@ voice.send_dtmf(response['uuid'], digits='1234')
response = client.get_recording(RECORDING_URL)
```

# Verify Class
## Verify API

## Creating an instance of the class
### Verify Class

To create an instance of the Verify class, Just follow these steps:
#### Creating an instance of the class

To create an instance of the Verify class, Just follow the next steps:

- **Import the class from module** (3 different ways)

```python
#First way
from nexmo import Verify

#Second way
from nexmo.verify import Verify

#Third valid way
import nexmo #then use nexmo.Verify() to create an instance
import nexmo #then you can use nexmo.Verify() to create an instance
```

- **Create the instance**

```python
#First way - pass key and secret to the constructor
Expand Down Expand Up @@ -412,7 +406,6 @@ else:
print("Error: %s" % response["error_text"])
```


## Number Insight API

### Basic Number Insight
Expand Down Expand Up @@ -559,7 +552,6 @@ client.host('mio.nexmo.com') #Change host to mio.nexmo.com - this change will be

These attributes are private in the client class and the only way to access them is using the getters/setters we provide.


```python
from nexmo import Client

Expand All @@ -571,7 +563,9 @@ client.api_host('myapi.nexmo.com') # rewrite the value of api_host
```

## Frequently Asked Questions

### Dropping support for Python 2.7

Back in 2014 when Guido van Rossum, Python's creator and principal author, made the announcement, January 1, 2020 seemed pretty far away. Python 2.7’s sunset has happened, after which there’ll be absolutely no more support from the core Python team. Many utilized projects pledge to drop Python 2 support in or before 2020. [(Official statement here)](https://www.python.org/doc/sunset-python-2/).

Just because 2.7 isn’t going to be maintained past 2020 doesn’t mean your applications or libraries suddenly stop working but as of this moment we won't give official support for upcoming releases. Please read the official ["Porting Python 2 Code to Python 3" guide](https://docs.python.org/3/howto/pyporting.html). Please also read the [Python 3 Statement Practicalities](https://python3statement.org/practicalities/) for advice on sunsetting your Python 2 code.
Expand All @@ -580,25 +574,25 @@ Just because 2.7 isn’t going to be maintained past 2020 doesn’t mean your ap

The following is a list of Vonage APIs and whether the Python SDK provides support for them:

| API | API Release Status | Supported?
|----------|:---------:|:-------------:|
| Account API | General Availability ||
| Alerts API | General Availability ||
| Application API | General Availability ||
| Audit API | Beta ||
| Conversation API | Beta ||
| Dispatch API | Beta ||
| External Accounts API | Beta ||
| Media API | Beta ||
| Messages API | Beta ||
| Number Insight API | General Availability ||
| Number Management API | General Availability ||
| Pricing API | General Availability ||
| Redact API | General Availability ||
| Reports API | Beta ||
| SMS API | General Availability ||
| Verify API | General Availability ||
| Voice API | General Availability ||
| API | API Release Status | Supported? |
| --------------------- | :------------------: | :--------: |
| Account API | General Availability ||
| Alerts API | General Availability ||
| Application API | General Availability ||
| Audit API | Beta ||
| Conversation API | Beta ||
| Dispatch API | Beta ||
| External Accounts API | Beta ||
| Media API | Beta ||
| Messages API | Beta ||
| Number Insight API | General Availability ||
| Number Management API | General Availability ||
| Pricing API | General Availability ||
| Redact API | General Availability ||
| Reports API | Beta ||
| SMS API | General Availability ||
| Verify API | General Availability ||
| Voice API | General Availability ||

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pytest==3.1.2
pytest-cov==2.5.1
responses==0.5.1
coveralls
glom==18.3.1
glom==18.3.1
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="nexmo",
version="2.5.0",
version="2.5.2",
description="Nexmo Client Library for Python",
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -22,7 +22,12 @@
packages=find_packages(where="src"),
package_dir={"": "src"},
platforms=["any"],
install_requires=["requests>=2.4.2", "PyJWT[crypto]>=1.6.4", "pytz>=2018.5"],
install_requires=[
"requests>=2.4.2",
"PyJWT[crypto]>=1.6.4",
"pytz>=2018.5",
"Deprecated",
],
python_requires=">=3, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
tests_require=["cryptography>=2.3.1"],
classifiers=[
Expand Down
Loading

0 comments on commit 86ef8a4

Please sign in to comment.