notebook

cloud.notebook

Python support for notebook I/O on Tiledb Cloud. All notebook JSON content is assumed to be encoded as UTF-8.

Classes

Name Description
OnExists Action to take if the array already exists.

OnExists

cloud.notebook.OnExists()

Action to take if the array already exists.

Functions

Name Description
download_notebook_contents Downloads a notebook file from TileDB Cloud to contents as a string,
download_notebook_to_file Downloads a notebook file from TileDB Cloud to local disk.
rename_notebook Update an array’s info
upload_notebook_contents Uploads a notebook file to TileDB Cloud.
upload_notebook_from_file Uploads a local-disk notebook file to TileDB Cloud.

download_notebook_contents

cloud.notebook.download_notebook_contents(tiledb_uri, *, timestamp=None)

Downloads a notebook file from TileDB Cloud to contents as a string, nominally in JSON format.

Parameters

Name Type Description Default
tiledb_uri str such as “tiledb://TileDB-Inc/quickstart_dense”. required
timestamp Union[int, datetime.datetime, None] If set, the timestamp to download the notebook as of. None

Returns

Name Type Description
str contents of the notebook file as a string, nominally in JSON format.

download_notebook_to_file

cloud.notebook.download_notebook_to_file(
    tiledb_uri
    ipynb_file_name
    *
    timestamp=None
)

Downloads a notebook file from TileDB Cloud to local disk.

Parameters

Name Type Description Default
tiledb_uri str such as “tiledb://TileDB-Inc/quickstart_dense”. required
ipynb_file_name str path to save to, such as “./mycopy.ipynb”. Must be local; no other VFS backends are currently supported. required
timestamp Union[int, datetime.datetime, None] If set, the timestamp to download the notebook as of. None

rename_notebook

cloud.notebook.rename_notebook(
    tiledb_uri
    notebook_name=None
    access_credentials_name=None
    async_req=False
)

Update an array’s info

Parameters

Name Type Description Default
tiledb_uri str such as “tiledb://TileDB-Inc/quickstart_dense”. required
notebook_name str such as “quickstart_dense_new_name”. None
access_credentials_name str optional name of access credentials to use. If left blank. default for namespace will be used. None
async_req bool return future instead of results for async support. False

upload_notebook_contents

cloud.notebook.upload_notebook_contents(
    ipynb_file_contents
    *
    dest_uri=None
    namespace=None
    array_name=None
    storage_path=None
    storage_credential_name=None
    on_exists
)

Uploads a notebook file to TileDB Cloud.

Parameters

Name Type Description Default
ipynb_file_contents str The contents of the notebook file as a string, nominally in JSON format. required
dest_uri Optional[str] The destination URI to upload the notebook to, such as tiledb://janedoe/testing-upload. If this is set, namespace and array_name may not be set. None
storage_path Optional[str] such as “s3://acmecorp-janedoe”, typically from the user’s account settings. None
array_name name to be seen in the UI, such as “testing-upload” required
namespace Optional[str] such as “janedoe”. None
storage_credential_name Optional[str] such as “janedoe-creds”, typically from the user’s account settings. None
on_exists OnExists such as OnExists.FAIL (default), OVERWRITE or AUTO-INCREMENT required

Returns

Name Type Description
str TileDB array name, such as “tiledb://janedoe/testing-upload”.

upload_notebook_from_file

cloud.notebook.upload_notebook_from_file(
    ipynb_file_name
    *
    dest_uri=None
    namespace=None
    array_name=None
    storage_path=None
    storage_credential_name=None
    on_exists=OnExists.FAIL
)

Uploads a local-disk notebook file to TileDB Cloud.

Parameters

Name Type Description Default
ipnyb_file_name such as “./mycopy.ipynb”. Must be local; no S3 URI support at present. required
dest_uri Optional[str] The destination URI to upload the notebook to, such as tiledb://janedoe/testing-upload. If this is set, namespace and array_name may not be set. None
namespace Optional[str] such as “janedoe”. None
array_name Optional[str] name to be seen in the UI, such as “testing-upload”. None
storage_path Optional[str] such as “s3://acmecorp-janedoe”, typically from the user’s account settings. None
storage_credential_name Optional[str] such as “janedoe-creds”, typically from the user’s account settings. None
on_exists OnExists such as OnExists.FAIL (default), OVERWRITE or AUTO-INCREMENT OnExists.FAIL

Returns

Name Type Description
str TileDB array name, such as “tiledb://janedoe/testing-upload”.