caterva2.Client.remove#
- Client.remove(path)#
Removes a dataset or the contents of a directory from a remote repository.
Note: When a directory is removed, only its contents are deleted; the directory itself remains. This behavior allows for future uploads to the same directory. It is subject to in future versions.
- Parameters:
path¶ (Path) – Path of the dataset or directory to remove.
- Returns:
The path that was removed.
- Return type:
str
Examples
>>> import caterva2 as cat2 >>> import numpy as np >>> # To remove a file you need to be a registered used >>> client = cat2.Client('https://cat2.cloud/demo', ("joedoe@example.com", "foobar")) >>> path = f'@personal/dir{np.random.randint(0, 100)}/ds-4d.b2nd' >>> uploaded_path = client.upload('root-example/dir2/ds-4d.b2nd', path) >>> removed_path = client.remove(path) >>> removed_path == path True