Using project-lib for Python (Watson Studio)

The project-lib library for Python contains a set of functions that help you to interact with Watson Studio projects and project assets. You can think of the library as a programmatical interface to a project. Using the project-lib library, you can access project metadata and assets, including files and connections. The library also contains functions that simplify fetching files associated with the project.

Note:

The project-lib functions

The instantiated project object that is created after you have imported the project-lib library exposes a set of functions that are grouped in the following way:

Fetch project information

You can use the following functions to fetch project-related information programmatically:

Fetch files

You can use the following function to fetch files associated with your project.

Save data

You can use the following function to save data to a file associated with your project. This function does multiple things. Firstly, it puts the data into a file and then it adds this data as a data asset to your project so you can see the data that you saved as a file in the data assets list in your project.

Read data from a connection

You can use the following function to get the metadata (credentials) of a given connection.

Fetch connected data

You can use the following function to fetch the credentials of connected data. The function returns a dictionary that contains the connection credentials in addition to a datapath attribute that points to specific data in that connection, for example, a table in a dashDB instance or a database in a Cloudant instance.

Learn more

See a demo of these functions in a blog post.