nemo_export.tarutils
#
Module Contents#
Classes#
A class that represents a path inside a TAR archive and behaves like pathlib.Path. |
|
An implementation of read-only Store for zarr library that works with pathlib.Path or TarPath objects. |
Data#
API#
- nemo_export.tarutils.LOGGER = 'getLogger(...)'#
- class nemo_export.tarutils.TarPath(
- tar: Union[str, tarfile.TarFile, nemo_export.tarutils.TarPath],
- *parts,
A class that represents a path inside a TAR archive and behaves like pathlib.Path.
Expected use is to create a TarPath for the root of the archive first, and then derive paths to other files or directories inside the archive like so:
with TarPath(‘/path/to/archive.tar’) as archive: myfile = archive / ‘filename.txt’ if myfile.exists(): data = myfile.read() …
Only read and enumeration operations are supported.
Initialization
- __truediv__(key) nemo_export.tarutils.TarPath [source]#
- property tarobject#
Returns the wrapped tar object.
- property relpath#
Returns the relative path of the path.
- property name#
Returns the name of the path.
- property suffix#
Returns the suffix of the path.
- class nemo_export.tarutils.ZarrPathStore(tarpath: nemo_export.tarutils.TarPath)[source]#
Bases:
zarr.storage.BaseStore
An implementation of read-only Store for zarr library that works with pathlib.Path or TarPath objects.
Initialization