caterva2.Root.upload#
- Root.upload(localpath, dataset=None)#
Upload a local dataset to this root.
- Parameters:
- Returns:
- Return type:
Examples
>>> import caterva2 as cat2 >>> import numpy as np >>> # To upload a file you must be registered as a user. >>> urlbase = 'https://cat2.cloud/demo' >>> root = cat2.Root('@personal', urlbase, dict(username='user@example.com', password='foo')) >>> path = f'@personal/dir{np.random.randint(0, 100)}/ds-4d.b2nd' >>> root.upload('root-example/dir2/ds-4d.b2nd') <Dataset: @personal/root-example/dir2/ds-4d.b2nd> >>> 'root-example/dir2/ds-4d.b2nd' in root True