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
OnExists |
Action to take if the array already exists. |
OnExists
cloud.notebook.OnExists()
Action to take if the array already exists.
Functions
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
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
|
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
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
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
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
|
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
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
|
str |
TileDB array name, such as “tiledb://janedoe/testing-upload”. |