Skip to content

Commit 86ef8a4

Browse files
authored
Merge pull request #163 from Vonage/v251-patch
2.5.2 Patch
2 parents dc4b10d + 4a252b4 commit 86ef8a4

File tree

9 files changed

+598
-86
lines changed

9 files changed

+598
-86
lines changed

CHANGES.md

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,106 @@
1+
# 2.5.x
2+
3+
- Support for Independent SMS, Voice and Verify APIs with tests as well as current client methods
4+
- Getters/Setters to extract/rewrite custom attributes
5+
- PSD2 Verification support
6+
- Dropping support for Python 2.7
7+
- Roadmap to better error handling
8+
- Supporting Python 3.8
9+
110
# 2.4.0
2-
* Application V2 API added under `Client.application_v2`
3-
* Existing application methods under `Client` are now deprecated.
11+
12+
- Application V2 API added under `Client.application_v2`
13+
- Existing application methods under `Client` are now deprecated.
414

515
# 2.3.0
6-
* Explicit parameter list for the `nexmo.Client` constructor. **This may cause errors in code passing incorrect or spurious arguments to the Client constructor.**
7-
* Secret Management
8-
* Support for Authorization header authentication.
16+
17+
- Explicit parameter list for the `nexmo.Client` constructor. **This may cause errors in code passing incorrect or spurious arguments to the Client constructor.**
18+
- Secret Management
19+
- Support for Authorization header authentication.
920

1021
# 2.2.0
11-
* Add support for `redact_transaction`.
22+
23+
- Add support for `redact_transaction`.
1224

1325
# 2.1.0
14-
* Add support for `get_recording`
15-
* Add support for SMS conversion
16-
* Add debug logging for most calls, under the 'nexmo' logger.
17-
* Internal refactoring (affects only private methods.)
26+
27+
- Add support for `get_recording`
28+
- Add support for SMS conversion
29+
- Add debug logging for most calls, under the 'nexmo' logger.
30+
- Internal refactoring (affects only private methods.)
1831

1932
# 2.0.0
20-
* Drop support for Python 3.3 (in line with the cryptography library we depend upon)
21-
* Ensure timestamp is added the params list if signing requests
22-
* Avoid value injection in signature auth.
23-
* Add support for different hashes for signature generation (thanks @trancee!)
24-
* Tests ported to pytest
33+
34+
- Drop support for Python 3.3 (in line with the cryptography library we depend upon)
35+
- Ensure timestamp is added the params list if signing requests
36+
- Avoid value injection in signature auth.
37+
- Add support for different hashes for signature generation (thanks @trancee!)
38+
- Tests ported to pytest
2539

2640
# 1.5.0
2741

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

30-
* Add send/stop endpoints for audio/speech/dtmf
44+
- Add send/stop endpoints for audio/speech/dtmf
3145

32-
* Add new number insight endpoints
46+
- Add new number insight endpoints
3347

3448
# 1.4.0
3549

36-
* Add new Voice API call methods
50+
- Add new Voice API call methods
3751

38-
* Add Application API methods
52+
- Add Application API methods
3953

40-
* Add check_signature method for checking callback signatures
54+
- Add check_signature method for checking callback signatures
4155

42-
* Deprecate old Verify API methods
56+
- Deprecate old Verify API methods
4357

4458
# 1.3.0
4559

46-
* Add get_sms_pricing method
60+
- Add get_sms_pricing method
4761

48-
* Add get_voice_pricing method
62+
- Add get_voice_pricing method
4963

50-
* Add get_event_alert_numbers method to get opt-in/opt-out numbers
64+
- Add get_event_alert_numbers method to get opt-in/opt-out numbers
5165

52-
* Add resubscribe_event_alert_number method to opt-in a number
66+
- Add resubscribe_event_alert_number method to opt-in a number
5367

54-
* Add more clearly named methods for Verify API
68+
- Add more clearly named methods for Verify API
5569

56-
* Add app_name and app_version options
70+
- Add app_name and app_version options
5771

5872
# 1.2.0
5973

60-
* Add topup method
74+
- Add topup method
6175

62-
* Add update_settings method
76+
- Add update_settings method
6377

64-
* Add api_host attribute
78+
- Add api_host attribute
6579

66-
* Add ClientError and ServerError classes
80+
- Add ClientError and ServerError classes
6781

6882
# 1.1.0
6983

70-
* Move repository to https://github.com/Nexmo/nexmo-python
84+
- Move repository to https://github.com/Nexmo/nexmo-python
7185

72-
* Add get_basic_number_insight method for Number Insight Basic API
86+
- Add get_basic_number_insight method for Number Insight Basic API
7387

74-
* Add get_number_insight method for Number Insight Standard API
88+
- Add get_number_insight method for Number Insight Standard API
7589

76-
* Add User-Agent header to requests
90+
- Add User-Agent header to requests
7791

7892
# 1.0.3
7993

80-
* Change license from LGPL-3.0 to MIT
94+
- Change license from LGPL-3.0 to MIT
8195

8296
# 1.0.2
8397

84-
* Remove merge helper function
98+
- Remove merge helper function
8599

86100
# 1.0.1
87101

88-
* Python 3.x fixes
102+
- Python 3.x fixes
89103

90104
# 1.0.0
91105

92-
* First version!
106+
- First version!

README.md

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
This is the Python client library for Nexmo's API. To use it you'll
1010
need a Nexmo account. Sign up [for free at nexmo.com][signup].
1111

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

26-
2725
## Installation
2826

2927
To install the Python client library using pip:
@@ -86,7 +84,7 @@ from nexmo import Sms
8684
from nexmo.sms import Sms
8785

8886
#Option 3
89-
import nexmo #then tou can use nexmo.Sms() to create an instance
87+
import nexmo #then you can use nexmo.Sms() to create an instance
9088
```
9189

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

142140
### Make a call
143141

144-
145142
```python
146143
from nexmo import Client, Voice
147144
client = Client(application_id=APPLICATION_ID, private_key=PRIVATE_KEY)
@@ -162,18 +159,15 @@ voice = Voice(client)
162159
voice.get_calls()
163160
```
164161

165-
166162
### Retrieve a single call
167163

168-
169164
```python
170165
from nexmo import Client, Voice
171166
client = Client(application_id=APPLICATION_ID, private_key=PRIVATE_KEY)
172167
voice = Voice(client)
173168
voice.get_call(uuid)
174169
```
175170

176-
177171
### Update a call
178172

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

191-
192185
### Stream audio to a call
193186

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

207-
208200
### Stop streaming audio to a call
209201

210202
```python
@@ -221,7 +213,6 @@ voice.send_audio(response['uuid'],stream_url=[stream_url])
221213
voice.stop_audio(response['uuid'])
222214
```
223215

224-
225216
### Send a synthesized speech message to a call
226217

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

254245
### Send DTMF tones to a call
255246

256-
257247
```python
258248
from nexmo import Client, Voice
259249
client = Client(application_id=APPLICATION_ID, private_key=PRIVATE_KEY)
@@ -272,26 +262,30 @@ voice.send_dtmf(response['uuid'], digits='1234')
272262
response = client.get_recording(RECORDING_URL)
273263
```
274264

275-
# Verify Class
265+
## Verify API
276266

277-
## Creating an instance of the class
267+
### Verify Class
278268

279-
To create an instance of the Verify class, Just follow these steps:
269+
#### Creating an instance of the class
270+
271+
To create an instance of the Verify class, Just follow the next steps:
272+
280273

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

283276
```python
284277
#First way
285278
from nexmo import Verify
286-
279+
287280
#Second way
288281
from nexmo.verify import Verify
289-
282+
290283
#Third valid way
291-
import nexmo #then use nexmo.Verify() to create an instance
284+
import nexmo #then you can use nexmo.Verify() to create an instance
292285
```
293286

294287
- **Create the instance**
288+
295289

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

415-
416409
## Number Insight API
417410

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

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

562-
563555
```python
564556
from nexmo import Client
565557

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

573565
## Frequently Asked Questions
566+
574567
### Dropping support for Python 2.7
568+
575569
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/).
576570

577571
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.
@@ -580,25 +574,25 @@ Just because 2.7 isn’t going to be maintained past 2020 doesn’t mean your ap
580574

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

583-
| API | API Release Status | Supported?
584-
|----------|:---------:|:-------------:|
585-
| Account API | General Availability ||
586-
| Alerts API | General Availability ||
587-
| Application API | General Availability ||
588-
| Audit API | Beta ||
589-
| Conversation API | Beta ||
590-
| Dispatch API | Beta ||
591-
| External Accounts API | Beta ||
592-
| Media API | Beta ||
593-
| Messages API | Beta ||
594-
| Number Insight API | General Availability ||
595-
| Number Management API | General Availability ||
596-
| Pricing API | General Availability ||
597-
| Redact API | General Availability ||
598-
| Reports API | Beta ||
599-
| SMS API | General Availability ||
600-
| Verify API | General Availability ||
601-
| Voice API | General Availability ||
577+
| API | API Release Status | Supported? |
578+
| --------------------- | :------------------: | :--------: |
579+
| Account API | General Availability ||
580+
| Alerts API | General Availability ||
581+
| Application API | General Availability ||
582+
| Audit API | Beta ||
583+
| Conversation API | Beta ||
584+
| Dispatch API | Beta ||
585+
| External Accounts API | Beta ||
586+
| Media API | Beta ||
587+
| Messages API | Beta ||
588+
| Number Insight API | General Availability ||
589+
| Number Management API | General Availability ||
590+
| Pricing API | General Availability ||
591+
| Redact API | General Availability ||
592+
| Reports API | Beta ||
593+
| SMS API | General Availability ||
594+
| Verify API | General Availability ||
595+
| Voice API | General Availability ||
602596

603597
## Contributing
604598

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ pytest==3.1.2
33
pytest-cov==2.5.1
44
responses==0.5.1
55
coveralls
6-
glom==18.3.1
6+
glom==18.3.1

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="nexmo",
14-
version="2.5.0",
14+
version="2.5.2",
1515
description="Nexmo Client Library for Python",
1616
long_description=long_description,
1717
long_description_content_type="text/markdown",
@@ -22,7 +22,12 @@
2222
packages=find_packages(where="src"),
2323
package_dir={"": "src"},
2424
platforms=["any"],
25-
install_requires=["requests>=2.4.2", "PyJWT[crypto]>=1.6.4", "pytz>=2018.5"],
25+
install_requires=[
26+
"requests>=2.4.2",
27+
"PyJWT[crypto]>=1.6.4",
28+
"pytz>=2018.5",
29+
"Deprecated",
30+
],
2631
python_requires=">=3, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
2732
tests_require=["cryptography>=2.3.1"],
2833
classifiers=[

0 commit comments

Comments
 (0)