caterva2.Root#
- class caterva2.Root(name, urlbase=None, user_auth=None)#
Represents a remote repository that can be subscribed to.
- Parameters:
root¶ (str) – Name of the root to subscribe to.
urlbase¶ (str, optional) – Base URL to query. Defaults to
caterva2.sub_urlbase_default
.user_auth¶ (dict, optional) – Mapping of fields and values for user authentication. This is used to post data for obtaining an authorization token for further requests. For some actions, this must be provided unless already specified in a :py_obj:`caterva2.c2context`.
Examples
>>> import caterva2 as cat2 >>> root = cat2.Root('example', 'https://demo.caterva2.net') >>> root.file_list[-3:] ['dir2/ds-4d.b2nd', 'dir1/ds-3d.b2nd', 'dir1/ds-2d.b2nd']
- Attributes:
file_list
Retrieves a list of files in this root.
Methods
upload
(localpath[, dataset])Uploads a local dataset to this root.
- __init__(name, urlbase=None, user_auth=None)#
Methods
__init__
(name[, urlbase, user_auth])upload
(localpath[, dataset])Uploads a local dataset to this root.
Attributes
Retrieves a list of files in this root.