pynapple.io.folder.Folder#
- class pynapple.io.folder.Folder(path)[source]#
Bases:
UserDictDictionnary like object to walk and loop through nested folders. Handles files and sub-folders discovery
Methods
__init__(path)Initialize the Folder object
clear()copy()doc(name)Display the metadata within the json sidecar of a NPZ file
expand()Display the full tree view.
fromkeys(iterable[, value])get(k[,d])info(name)Display the metadata within the json sidecar of a NPZ file
items()keys()load()Load all compatible NPZ files.
metadata(name)Display the metadata within the json sidecar of a NPZ file
pop(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem()as a 2-tuple; but raise KeyError if D is empty.
save(name, obj[, description])Save a pynapple object in the folder in a single file in uncompressed
.npzformat.setdefault(k[,d])update([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values()Attributes
Summary
- clear() None. Remove all items from D.#
- copy()#
- doc(name)[source]#
Display the metadata within the json sidecar of a NPZ file
- Parameters:
name (str) – Name of the npz file
- classmethod fromkeys(iterable, value=None)#
- get(k[, d]) D[k] if k in D, else d. d defaults to None.#
- info(name)[source]#
Display the metadata within the json sidecar of a NPZ file
- Parameters:
name (str) – Name of the npz file
- items() a set-like object providing a view on D's items#
- keys() a set-like object providing a view on D's keys#
- metadata(name)[source]#
Display the metadata within the json sidecar of a NPZ file
- Parameters:
name (str) – Name of the npz file
- pop(k[, d]) v, remove specified key and return the corresponding value.#
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair#
as a 2-tuple; but raise KeyError if D is empty.
- save(name, obj, description='')[source]#
Save a pynapple object in the folder in a single file in uncompressed
.npzformat. By default, the save function overwrite previously save file with the same name.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D#
- update([E, ]**F) None. Update D from mapping/iterable E and F.#
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values#
- property view#
Summary