Technology moves fast! ⚡ Don't get left behind.🚶 Subscribe to our mailing list to keep up with latest and greatest in open source projects! 🏆


Subscribe to our mailing list

python-sdk

: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 1 year ago
Repo Created over 3 years ago
Repo Last Updated about 1 year ago
Size 8.58 MB
Homepage https://pypi.pyth...
Organization / Authorwatson-developer-cloud
Latest Releasev1.1.0
Contributors3
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 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

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.

Installation

To install, use pip or easy_install:

pip install --upgrade watson-developer-cloud

or

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

Examples

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.

Migration

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(
    username='xxx',
    password='yyy',
    version='2017-04-21')

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))

Dependencies

  • 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

Contributing

See CONTRIBUTING.md.

License

This library is licensed under the Apache 2.0 license.

python-sdk open issues Ask a question     (View All Issues)
  • over 2 years AlchemyLanguageV1: "anchorDate" not working correctly
  • over 2 years Support Speech to Text customizations
  • over 2 years Support Visual Recognition similarity search
  • over 2 years Narrowband error
  • over 2 years pip install problem
  • over 2 years API Reference lacks Python examples
  • over 3 years Switch Speech to Text to use WebSockets
  • almost 2 years Asynchronous STT support?
  • almost 2 years is it possible to add credentials files for bluemix ?
  • almost 2 years pip install after bump to 0.26.0 now requires compiler for cffi (may be intentional?)
  • almost 2 years Unable to add Images to Custom Collection using visual_recognition_v3 add_image in Python
  • almost 2 years Unable to classify zip files
  • almost 2 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