caterva2.Dataset#
- class caterva2.Dataset(root, path)#
- Attributes:
- blocks
- chunks
- client
- cookie
- dtype
- shape
- urlbase
- vlmeta
Returns a mapping of metalayer names to their respective values.
This is used to access variable-length metalayers (user attributes) associated with the file.
>>> import caterva2 as cat2 >>> client = cat2.Client('https://demo.caterva2.net') >>> root = client.get('example') >>> file = root['ds-sc-attr.b2nd'] >>> file.vlmeta {'a': 1, 'b': 'foo', 'c': 123.456}
Methods
append
(data)Appends data to the dataset.
copy
(dst)Copies the file to a new location.
download
([localpath])Downloads the file to storage.
Retrieves the download URL for the file.
move
(dst)Moves the file to a new location.
remove
()Removes the file from the remote repository.
slice
(key[, as_blosc2])Get a slice of a File/Dataset.
- __init__(root, path)#
Represents a dataset within a Blosc2 container.
This class is not intended to be instantiated directly; it should be accessed through a
Root
instance.Examples
>>> import caterva2 as cat2 >>> client = cat2.Client('https://demo.caterva2.net') >>> root = client.get('example') >>> ds = root['ds-1d.b2nd'] >>> ds.dtype 'int64' >>> ds.shape (1000,) >>> ds.chunks (100,) >>> ds.blocks (10,)
Methods
__init__
(root, path)Represents a dataset within a Blosc2 container.
copy
(dst)Copies the file to a new location.
download
([localpath])Downloads the file to storage.
Retrieves the download URL for the file.
move
(dst)Moves the file to a new location.
remove
()Removes the file from the remote repository.
Attributes
Returns a mapping of metalayer names to their respective values.