Skip to content

Commit f3d8028

Browse files
authored
Merge pull request #653 from watson-developer-cloud/v3.0.0
Release v3.0.0
2 parents f0dbe8b + ad035bf commit f3d8028

File tree

89 files changed

+5293
-5996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+5293
-5996
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
current_version = 2.10.0
33
commit = True
44

5-
[bumpversion:file:watson_developer_cloud/version.py]
5+
[bumpversion:file:ibm_watson/version.py]
66
search = __version__ = '{current_version}'
77
replace = __version__ = '{new_version}'
88

.travis.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
language: python
2-
python:
3-
- '2.7'
4-
- '3.4'
5-
- '3.5'
6-
- '3.6'
2+
matrix:
3+
include:
4+
- python: 2.7
5+
- python: 3.4
6+
- python: 3.5
7+
- python: 3.6
8+
- python: 3.7
9+
dist: xenial
10+
sudo: true
711
cache: pip
812
before_install:
913
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_cebf25e6c525_key
@@ -37,9 +41,8 @@ deploy:
3741
python: '3.5'
3842
branch: master
3943
- provider: pypi
40-
user: ehdsouza
41-
password:
42-
secure: eMssjS1Airz5MrmcEDAnKYnTlMLuzinX8JFsh4TB0A4t7GCes2a/mlvcoazAv2QZMQUKQMC++bAXYGGgXtsSQsfOYnRtojW4pRphxOZrlXlWFgCLGz/eHioamNZVbH+/P/OYjbLy5ZKSzp3M3bZxYqHcmGTq0sBeo5A2Ilkzu5P+D865Jqtn52brwh/xYq4XWeJeQN/BSLwdtPEtZYQXhQupAteNDAo2ON0FVyt0amINrjA0Qw+0k35g36wti+CsKn5fhbaHf6jjN0oRj8J8wPZieXLAUMdxscfBjUXJ8AK8E4H/wPI30IsaMus+1r85ekiDKZC5iukO6uqMARFywjX/eTIDbWxwKImQUgvVa2+gncre7GvZrHIFxhIDDkssH1IfC1fcw3mNY4vCO9df/vHStp3Kvi27GvsYJnfsbXXj6fAhokHtsrnrbpXFET6LghGQx3HgOKrlCQ1EI0Fk92Qw7+g15jwMGlkwUE1qMS+PVOe7dQ4ikxJgw4CVrqU6/zaLFHV8LXFfjv166ZSWcOJHJXGgJ2TPuGiooL60+pWp/UYY00hZVlYX0Vlks6zN0h9zJd16kR3EwDrW0muqFnLC2xTuv5WsCjsOATtsTQzmBNEdCbGdOskgF4+0yPe7ps3kEs3UpAooKtYVh1OOJAUkl4vSMyu4Jg1ASyQWt00=
44+
user: watson-devex
45+
password: $PYPI_PASSWORD
4346
repository: https://upload.pypi.org/legacy
4447
skip_cleanup: true
4548
on:

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ include README.md
22
include LICENSE
33

44
recursive-include examples *.py *.md
5-
recursive-include watson_developer_cloud *.py *.md
5+
recursive-include ibm_watson *.py *.md
66
global-exclude .DS_Store
77
global-exclude *.pyc

README.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Python client library to quickly get started with the various [Watson APIs][wdc]
2121
* [Python version](#python-version)
2222
* [Changes for v1.0](#changes-for-v10)
2323
* [Changes for v2.0](#changes-for-v20)
24+
* [Changes for v3.0](#changes-for-v30)
2425
* [Migration](#migration)
2526
* [Configuring the http client](#configuring-the-http-client-supported-from-v110)
2627
* [Disable SSL certificate verification](#disable-ssl-certificate-verification)
@@ -36,31 +37,34 @@ Python client library to quickly get started with the various [Watson APIs][wdc]
3637
* You need an [IBM Cloud][ibm-cloud-onboarding] account.
3738

3839
## Installation
39-
Note: We are moving to `ibm-watson`. All versions prior to v3.0.0 can still be found in `watson-developer-cloud`
40-
4140
To install, use `pip` or `easy_install`:
4241

4342
```bash
44-
pip install --upgrade watson-developer-cloud
43+
pip install --upgrade ibm-watson
4544
```
4645

4746
or
4847

4948
```bash
50-
easy_install --upgrade watson-developer-cloud
49+
easy_install --upgrade ibm-watson
5150
```
5251

5352
Note the following:
53+
a) Versions prior to 3.0.0 can be installed using:
54+
55+
```bash
56+
pip install --upgrade watson-developer-cloud
57+
```
5458

55-
a) If you run into permission issues try:
59+
b) If you run into permission issues try:
5660

5761
```bash
58-
sudo -H pip install --ignore-installed six watson-developer-cloud
62+
sudo -H pip install --ignore-installed six ibm-watson
5963
```
6064

6165
For more details see [#225](https://github.com/watson-developer-cloud/python-sdk/issues/225)
6266

63-
b) In case you run into problems installing the SDK in DSX, try
67+
c) In case you run into problems installing the SDK in DSX, try
6468
```
6569
!pip install --upgrade pip
6670
```
@@ -74,7 +78,7 @@ The [examples][examples] folder has basic and advanced examples. The examples wi
7478

7579
## Running in IBM Cloud
7680

77-
If you run your app in IBM Cloud, the SDK gets credentials from the [`VCAP_SERVICES`][vcap_services] environment variable.
81+
If you run your app in IBM Cloud, the SDK gets credentials from the [`VCAP_SERVICES`][vcap_services] environment variable.
7882

7983
## Authentication
8084

@@ -94,6 +98,9 @@ To find out which authentication to use, view the service credentials. You find
9498

9599
On this page, you should be able to see your credentials for accessing your service instance.
96100

101+
![alt text](https://cdn-images-1.medium.com/max/1600/1*DaTt56z0RaKlbyWDUaRJgQ.png)
102+
103+
97104
### Supplying credentials
98105

99106
There are two ways to supply the credentials you found above to the SDK for authentication.
@@ -143,14 +150,14 @@ You supply either an IAM service **API key** or an **access token**:
143150
# In the constructor, letting the SDK manage the IAM token
144151
discovery = DiscoveryV1(version='2018-08-01',
145152
url='<url_as_per_region>',
146-
iam_apikey='<iam_apikey>',
153+
apikey='<apikey>',
147154
iam_url='<iam_url>') # optional - the default value is https://iam.bluemix.net/identity/token
148155
```
149156

150157
```python
151158
# after instantiation, letting the SDK manage the IAM token
152159
discovery = DiscoveryV1(version='2018-08-01', url='<url_as_per_region>')
153-
discovery.set_iam_apikey('<iam_apikey>')
160+
discovery.set_apikey('<apikey>')
154161
```
155162

156163
#### Supplying the access token
@@ -169,7 +176,7 @@ discovery.set_iam_access_token('<access_token>')
169176

170177
### Username and password
171178
```python
172-
from watson_developer_cloud import DiscoveryV1
179+
from ibm_watson import DiscoveryV1
173180
# In the constructor
174181
discovery = DiscoveryV1(version='2018-08-01', url='<url_as_per_region>', username='<username>', password='<password>')
175182
```
@@ -190,7 +197,7 @@ Version 1.0 focuses on the move to programmatically-generated code for many of t
190197
## Changes for v2.0
191198
`DetailedResponse` which contains the result, headers and HTTP status code is now the default response for all methods.
192199
```python
193-
from watson_developer_cloud import AssistantV1
200+
from ibm_watson import AssistantV1
194201

195202
assistant = AssistantV1(
196203
username='xxx',
@@ -205,14 +212,19 @@ print(response.get_status_code())
205212
```
206213
See the [changelog](https://github.com/watson-developer-cloud/python-sdk/wiki/Changelog) for the details.
207214

215+
## Changes for v3.0
216+
The SDK is generated using OpenAPI Specification(OAS3). Changes are basic reordering of parameters in function calls.
217+
218+
The package is renamed to ibm_watson. See the [changelog](https://github.com/watson-developer-cloud/python-sdk/wiki/Changelog) for the details.
219+
208220
## Migration
209221
This version includes many breaking changes as a result of standardizing behavior across the new generated services. Full details on migration from previous versions can be found [here](https://github.com/watson-developer-cloud/python-sdk/wiki/Migration).
210222

211223
## Configuring the http client (Supported from v1.1.0)
212224
To set client configs like timeout use the `with_http_config()` function and pass it a dictionary of configs.
213225

214226
```python
215-
from watson_developer_cloud import AssistantV1
227+
from ibm_watson import AssistantV1
216228

217229
assistant = AssistantV1(
218230
username='xxx',
@@ -243,7 +255,7 @@ headers = {
243255
For example, to send a header called `Custom-Header` to a call in Watson Assistant, pass
244256
the headers parameter as:
245257
```python
246-
from watson_developer_cloud import AssistantV1
258+
from ibm_watson import AssistantV1
247259

248260
assistant = AssistantV1(
249261
username='xxx',
@@ -257,7 +269,7 @@ response = assistant.list_workspaces(headers={'Custom-Header': 'custom_value'}).
257269
## Parsing HTTP response info
258270
If you would like access to some HTTP response information along with the response model, you can set the `set_detailed_response()` to `True`. Since Python SDK `v2.0`, it is set to `True`
259271
```python
260-
from watson_developer_cloud import AssistantV1
272+
from ibm_watson import AssistantV1
261273

262274
assistant = AssistantV1(
263275
username='xxx',
@@ -284,7 +296,7 @@ You can use the `get_result()`, `get_headers()` and get_status_code() to return
284296
The Text to Speech service supports synthesizing text to spoken audio using web sockets with the `synthesize_using_websocket`. The Speech to Text service supports recognizing speech to text using web sockets with the `recognize_using_websocket`. These methods need a custom callback class to listen to events. Below is an example of `synthesize_using_websocket`. Note: The service accepts one request per connection.
285297

286298
```py
287-
from watson_developer_cloud.websocket import SynthesizeCallback
299+
from ibm_watson.websocket import SynthesizeCallback
288300

289301
class MySynthesizeCallback(SynthesizeCallback):
290302
def __init__(self):
@@ -311,6 +323,7 @@ service.synthesize_using_websocket('I like to pet dogs',
311323
* [responses] for testing
312324
* Following for web sockets support in speech to text
313325
* `websocket-client` 0.48.0
326+
* `ibm_cloud_sdk_core` >=0.2.0
314327

315328
## Contributing
316329

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ build: off
2525

2626
test_script:
2727

28-
- ps: py.test --reruns 3 --cov=watson_developer_cloud
28+
- ps: py.test --reruns 3 --cov=ibm_watson
2929

3030
deploy: off
3131

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ clean:
5555

5656
document:
5757
rm -rf apis
58-
$(SPHINXAPIDOC) -o apis ../watson_developer_cloud -f -e -T
58+
$(SPHINXAPIDOC) -o apis ../ibm_watson -f -e -T
5959
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
6060
@echo
6161
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

docs/conf.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import sys
44
import os
5-
import watson_developer_cloud
5+
import ibm_watson
66

7-
sys.path.insert(0, os.path.abspath('../watson_developer_cloud/'))
7+
sys.path.insert(0, os.path.abspath('../ibm_watson/'))
88

99
from recommonmark.parser import CommonMarkParser
1010
source_parsers = {
@@ -45,8 +45,8 @@
4545
copyright = u'2015, IBM Corp'
4646
author = u'IBM Corp'
4747

48-
version = watson_developer_cloud.__version__
49-
release = watson_developer_cloud.__version__
48+
version = ibm_watson.__version__
49+
release = ibm_watson.__version__
5050

5151
# The language for content autogenerated by Sphinx. Refer to documentation
5252
# for a list of supported languages.
@@ -55,9 +55,9 @@
5555
# List of patterns, relative to source directory, that match files and
5656
# directories to ignore when looking for source files.
5757
exclude_patterns = ['_build', '_templates',
58-
'apis/modules.rst','apis/watson_developer_cloud.rst',
59-
'apis/watson_developer_cloud.version.rst',
60-
'apis/watson_developer_cloud.watson_developer_cloud_service.rst']
58+
'apis/modules.rst', 'apis/ibm_watson.rst',
59+
'apis/ibm_watson.version.rst',
60+
'apis/ibm_watson.ibm_watson_service.rst']
6161

6262
# If true, '()' will be appended to :func: etc. cross-reference text.
6363
add_function_parentheses = False
@@ -74,7 +74,7 @@
7474
pygments_style = 'sphinx'
7575

7676
# A list of ignored prefixes for module index sorting.
77-
modindex_common_prefix = ['watson_developer_cloud.']
77+
modindex_common_prefix = ['ibm_watson.']
7878

7979
# If true, keep warnings as "system message" paragraphs in the built documents.
8080
#keep_warnings = False
@@ -139,7 +139,7 @@
139139

140140
# Custom sidebar templates, maps document names to template names.
141141
html_sidebars = {
142-
'**': ['localtoc.html','sidebarintro.html', 'relations.html', 'sourcelink.html', 'searchbox.html']
142+
'**': ['localtoc.html', 'sidebarintro.html', 'relations.html', 'sourcelink.html', 'searchbox.html']
143143
}
144144

145145
# Additional templates that should be rendered to pages, maps page names to
@@ -192,17 +192,17 @@
192192
# -- Options for LaTeX output ---------------------------------------------
193193

194194
latex_elements = {
195-
# The paper size ('letterpaper' or 'a4paper').
196-
#'papersize': 'letterpaper',
195+
# The paper size ('letterpaper' or 'a4paper').
196+
#'papersize': 'letterpaper',
197197

198-
# The font size ('10pt', '11pt' or '12pt').
199-
#'pointsize': '10pt',
198+
# The font size ('10pt', '11pt' or '12pt').
199+
#'pointsize': '10pt',
200200

201-
# Additional stuff for the LaTeX preamble.
202-
#'preamble': '',
201+
# Additional stuff for the LaTeX preamble.
202+
#'preamble': '',
203203

204-
# Latex figure (float) alignment
205-
#'figure_align': 'htbp',
204+
# Latex figure (float) alignment
205+
#'figure_align': 'htbp',
206206
}
207207

208208
# Grouping the document tree into LaTeX files. List of tuples

docs/generate_index_html.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ echo '<!DOCTYPE html>
2020
<p><a href="https://www.ibm.com/watson/developer/">Info</a>
2121
| <a href="https://console.bluemix.net/developer/watson/documentation">Documentation</a>
2222
| <a href="https://github.com/watson-developer-cloud/python-sdk">GitHub</a>
23-
| <a href="https://pypi.python.org/pypi/watson-developer-cloud">pypi</a>
23+
| <a href="https://pypi.python.org/pypi/ibm-watson">pypi</a>
2424
</p>
2525
2626
<p>Documentation by branch/tag:</p>

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ To install, use ``pip`` or ``easy_install``:
1212

1313
.. code:: bash
1414
15-
$ pip install --upgrade watson-developer-cloud
15+
$ pip install --upgrade ibm-watson
1616
1717
or
1818

1919
.. code:: bash
2020
21-
$ easy_install --upgrade watson-developer-cloud
21+
$ easy_install --upgrade ibm-watson
2222
2323
Modules
2424
-------
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# see README.md for details
2+
3+
ASSISTANT_APIKEY=<Assistant Apikey>
4+
WORKSPACE_ID=<Workspace Id>
5+
6+
TONE_ANALYZER_APIKEY=<Tone Analyzer Apikey>

0 commit comments

Comments
 (0)