Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


:snake: Client library to use the IBM Watson services in Python and available in pip as watson-developer-cloud

Subscribe to updates I use python-sdk

Statistics on python-sdk

Number of watchers on Github 822
Number of open issues 7
Average time to close an issue 8 days
Main language Python
Average time to merge a PR 2 days
Open pull requests 9+
Closed pull requests 35+
Last commit about 2 years ago
Repo Created over 4 years ago
Repo Last Updated about 2 years ago
Size 8.58 MB
Homepage https://pypi.pyth...
Organization / Authorwatson-developer-cloud
Latest Releasev1.1.0
Page Updated
Do you use python-sdk? Leave a review!
View open issues (7)
View python-sdk activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating python-sdk for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Watson Developer Cloud Python SDK

Build Status Slack codecov.io Latest Stable Version

Python client library to quickly get started with the various Watson APIs services.


To install, use pip or easy_install:

pip install --upgrade watson-developer-cloud


easy_install --upgrade watson-developer-cloud

Note: If you run into permission issues try:

sudo -H pip install --ignore-installed six watson-developer-cloud

For more details see #225


The examples folder has basic and advanced examples.

Getting the Service Credentials

Service credentials are required to access the APIs.

If you run your app in IBM Cloud, you don't need to specify the username and password. In that case, the SDK uses the VCAP_SERVICES environment variable to load the credentials.

To run locally or outside of IBM Cloud you need the username and password credentials for each service. (Service credentials are different from your IBM Cloud account email and password.)

To create an instance of the service:

  1. Log in to IBM Cloud.
  2. Create an instance of the service:
    1. In the IBM Cloud Catalog, select the Watson service you want to use. For example, select the Conversation service.
    2. Type a unique name for the service instance in the Service name field. For example, type my-service-name. Leave the default values for the other options.
    3. Click Create.

To get your service credentials:

Copy your credentials from the Service details page. To find the the Service details page for an existing service, navigate to your IBM Cloud dashboard and click the service name.

  1. On the Service Details page, click Service Credentials, and then View credentials.
  2. Copy username, password, and url.

Python Version

Tested on Python 2.7, 3.4, 3.5, and 3.6.

Changes for v1.0

Version 1.0 focuses on the move to programmatically-generated code for many of the services. See the changelog for the details.


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.

Configuring the http client (Supported from v1.1.0)

To set client configs like timeout use the with_http_config() function and pass it a dictionary of configs.

from watson_developer_cloud import AssistantV1

assistant = AssistantV1(

assistant.set_http_config({'timeout': 100})
response = assistant.message(workspace_id=workspace_id, input={
    'text': 'What\'s the weather like?'})
print(json.dumps(response, indent=2))


  • requests
  • python_dateutil >= 2.5.3
  • responses for testing
  • Following for web sockets support in speech to text
    • autobahn >= 0.10.9
    • Twisted >= 13.2.0
    • pyOpenSSL >= 16.2.0
    • service-identity >= 17.0.0




This library is licensed under the Apache 2.0 license.

python-sdk open issues Ask a question     (View All Issues)
  • over 3 years AlchemyLanguageV1: "anchorDate" not working correctly
  • over 3 years Support Speech to Text customizations
  • over 3 years Support Visual Recognition similarity search
  • over 3 years Narrowband error
  • over 3 years pip install problem
  • almost 4 years API Reference lacks Python examples
  • over 4 years Switch Speech to Text to use WebSockets
  • about 3 years Asynchronous STT support?
  • about 3 years is it possible to add credentials files for bluemix ?
  • about 3 years pip install after bump to 0.26.0 now requires compiler for cffi (may be intentional?)
  • about 3 years Unable to add Images to Custom Collection using visual_recognition_v3 add_image in Python
  • about 3 years Unable to classify zip files
  • about 3 years Add ability to escape special characters when querying discovery
python-sdk open pull requests (View All Pulls)
  • "Unknown error" is "daily-transaction-limit-exceeded error"
  • Update Conversation for 04-21 release
  • Updated Conversation API-Version
  • [Do Not Merge] Very premilinary websockets
  • Discovery update collection method and related test
  • Fix PersonalityInsightsV3 problem "accept:text/csv" is not reflected
  • Generate Speech to Text
  • Generate Text to Speech
  • Speech_to_Text_Websocket (Python 3.5)
python-sdk questions on Stackoverflow (View All Questions)
  • How to set the properties of an Azure Table through python sdk
  • Read facebook messages using python sdk
  • Twilio returns a 401 unauthorized when using the Python SDK on Heroku
  • Swagger's Python SDK returns None despite the API call being successful
  • Why is the GAE python SDK using the system's python while in a virtualenv?
  • Ovirt Python SDK and Sysprep
  • Mendeley python sdk {"error_message":"Client authentication failed"}
  • Cannot set up a python SDK in Pycharm?
  • How to create a Shared Access Signature for a container with the Azure Python SDK
  • Python SDK Wit.ai "unable to retrieve libwit"
  • UnicodeDecodeError when uploading image bytes to Azure Block Blob via Python SDK
  • How to share a file using Microsoft OneDrive Python SDK?
  • Retrieving openid token with PayPal Python SDK fails
  • How to parse nested FB API response from Python SDK
  • Can't figure out how to modify Azure Loadbalancer BackEndPool with Python SDK
  • Cisco UCS Python SDK script for querying Firmware versions
  • Authenticate with Box Developer Edition using box-python-sdk
  • Verify requests with box-python-sdk
  • ImportError with GAE Python SDK 1.9.28 on Windows 10
  • Azure python sdk - getting the machine state
  • How to use Azure Python SDK for Azure Resource Manager APIs
  • Leap Motion Python SDK with conda
  • Async N1QL couchbase query using Twisted API for Python SDK
  • Azure Event Hub Python SDK - exceptions
  • "Max retries exceeded with url: /v1/oauth2/token" using PayPal REST API and Python SDK
  • How do I make Google App Engine python SDK Remote API work with local development server when server is bound to specific IP (not localhost)?
  • FacebookAds Python SDK AppID KeyError
  • Why does this Sparkpost Python SDK Install fail?
  • Filtering statistics from facebook ads api using the python sdk
  • Pubnub+Python SDK on an Ubuntu Azure-hosted machine. Connection problems
python-sdk list of languages used
Other projects in Python