Python utilities for IBM Watson Studio Pipelines
Project description
IBM Watson Studio Pipelines Python Client
This package provides various utilities for working with IBM Watson Studio Pipelines. Its primary usage is to enable users to store artifact results of a notebook run.
Usage
Construction
WSPipelines
client is constructed from IAM APIKEY, which can be provided
in a few ways:
-
explicitly:
from ibm_watson_studio_pipelines import WSPipelines client = WSPipelines(apikey) # or client = WSPipelines.from_apikey(apikey)
-
implicitly:
APIKEY=... export APIKEY
from ibm_watson_studio_pipelines import WSPipelines client = WSPipelines() # or client = WSPipelines.new_instance() # or client = WSPipelines.from_apikey()
All of the above may also define service_name
and url
.
Usage in Python notebooks
Notebooks run in IBM Watson Studio Pipelines get inputs and expose outputs as a node:
{
"id": ...,
"type": "execution_node",
"op": "run_container",
"app_data": {
"pipeline_data": {
"name": ...,
"config": {
"link": {
"component_id_ref": "run-notebook"
}
},
"inputs": [
...,
{
"name": "model_name",
"group": "env_variables",
"type": "String",
"value_from": ...
}
],
"outputs": [
{
"name": "trained_model",
"group": "output_variables",
"type": {
"CPDPath": {
"path_type": "resource",
"resource_type": "asset",
"asset_type": "wml_model"
}
}
}
]
}
},
...
}
Inside of the notebook, inputs are available as environmental variables:
model_name = os.environ['model_name']
Outputs are exposed using sdk method, store_results
:
client = WSPipelines.from_apikey(...)
client.store_results({
"trained_model": ... // cpd path to the trained model
})
Other features
Client also provides a method to get WML instance credentials:
client.get_wml_credentials() # the scope passed in notebook
# or
client.get_wml_credentials("cpd://projects/123456789")
Contribution
See a separate document on contribution.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ibm-watson-studio-pipelines-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | badcfbc746ec457598f5e0364b24369984c441153f14d5dc5c40b60c255e446f |
|
MD5 | 54e3426886a987ce860aa540cdf1cb1a |
|
BLAKE2b-256 | 42c514868c4cc28975ec450dcfd57b0d36ce79fe5775377f31614df220135f0c |
Hashes for ibm_watson_studio_pipelines-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ac4e5e42b0d5cdd7ff1034834c2be10f346efed8762f1cec1df913023021ea |
|
MD5 | d2e65ac02f588d8ab9658edf9e51ef70 |
|
BLAKE2b-256 | a549912fdeb89cb106d8cd61c1d9a8159ef57365729c1591c6c80fa97de91e33 |