blosc2.C2Array.__init__#

C2Array.__init__(path: str, /, urlbase: str = None, auth_token: str = None)#

Create an instance of a remote NDArray.

Parameters:
  • path (str) – The path to the remote NDArray file (root + file path) as a posix path.

  • urlbase (str) – The base URL (slash-terminated) of the subscriber to query.

  • auth_token (str) – An optional token to authorize requests via HTTP. Currently, it will be sent as an HTTP cookie.

Returns:

out

Return type:

C2Array

Examples

>>> import blosc2
>>> urlbase = "https://demo.caterva2.net/"
>>> path = "example/dir1/ds-3d.b2nd"
>>> remote_array = blosc2.C2Array(path, urlbase=urlbase)
>>> remote_array.shape
(3, 4, 5)
>>> remote_array.chunks
(2, 3, 4)
>>> remote_array.blocks
(2, 2, 2)
>>> remote_array.dtype
float32