caterva2.File.__init__#

File.__init__(root, path)#

Represents a file, which can be a Blosc2 dataset or a regular file on a root repository.

This class is not intended for direct instantiation; it should be accessed through a Root instance.

Parameters:
  • root (Root) – The root repository.

  • path (str) – The path of the file.

Examples

>>> import caterva2 as cat2
>>> client = cat2.Client('https://demo.caterva2.net')
>>> root = client.get('example')
>>> file = root['README.md']
>>> file
<File: example/README.md>
>>> file.name
'README.md'
>>> file.urlbase
'https://demo.caterva2.net'
>>> file.path
PurePosixPath('example/README.md')
>>> file.meta['contiguous']
True