Utility Functions#

The following functions are contained in the twinlab Core functionality.

User#

set_user(username[, verbose])

Set the username for their twinLab cloud account.

get_user([verbose])

Show the username for the twinLab cloud account.

API key#

set_api_key(api_key[, verbose])

Set the user API key for their twinLab cloud account.

get_api_key([verbose])

Show the user API key for their twinLab cloud account.

Server URL#

set_server_url(url[, verbose])

Set the server URL for twinLab.

get_server_url([verbose])

Show the URL from which twinLab is currently being accessed.

User information#

versions([verbose])

Get information about the twinLab version being used.

user_information([verbose])

Get information about the twinLab user.

Projects#

list_projects([verbose])

List projects that you own or are a part of.

create_project(project_id[, verbose])

Create a new project.

delete_project(project_id[, verbose])

Delete a project that you are the owner of.

share_project(project_id, user, role[, verbose])

Share a project with another user.

unshare_project(project_id, user[, verbose])

Remove a user from a project.

Datasets and emulators#

list_emulators([project_name, ...])

List trained emulators that exist in a project on the user's twinLab cloud account.

list_emulators_statuses([project_name, ...])

List the statuses of training and trained emulators in a project, as well as those that have failed to train If no project is specified, the default project is the user's "personal" project.

list_datasets([project_name, project_owner, ...])

List datasets that have been uploaded to a project in the user's twinLab cloud account.

list_example_datasets([verbose])

List example datasets that are available on the twinLab cloud.

load_example_dataset(dataset_id[, verbose])

Load an example dataset from the twinLab cloud into the current session.

Helper functions#

get_sample(df, key)

Retrieve an individual sample from the multi-indexed dataframe returned by the Emulator.sample() method.

join_samples(df_one, df_two)

Join two dataframes that contain independent samples generated by the Emulator.sample() method.

load_dataset(filepath[, verbose])

Load a dataset from a local file in .csv format into a pandas dataframe.

load_params(filepath[, verbose])

Load a parameter set from a local file in .json format into a dictionary.