caterva2.Root#
- class caterva2.Root(name, urlbase=None, user_auth=None)#
A root is a remote repository that can be subscribed to.
- Parameters:
root¶ (str) – The name of the root to subscribe to.
urlbase¶ (str) – The base of URLs of the subscriber to query. Default is
caterva2.sub_urlbase_default
.user_auth¶ (dict) – An optional mapping of fields and values to be used as data to be posted for authenticating the user and get an authorization token for further requests. For some actions this must be specified unless it was already specified inside 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
A list with the files in this root.
Methods
upload
(localpath[, dataset])Upload a local dataset to this root.
- __init__(name, urlbase=None, user_auth=None)#
Methods
__init__
(name[, urlbase, user_auth])upload
(localpath[, dataset])Upload a local dataset to this root.
Attributes
A list with the files in this root.