edlio package#
Module contents#
Module to work with data in an Experiment Directory Layout (EDL) structure
- class edlio.EDLCollection(name=None)#
Bases:
EDLGroup
An EDL Collection
- __init__(name=None)#
Create a new EDL collection.
If the collection has no name and path set, it can not be saved to disk.
- Parameters:
name – Name of this collection, or None
- property collection_idname: str#
Retrieve a human-readable string for this collection which is most likely (but not guaranteed to be) unique. If this collection has no properties set, the value of this property may be None or empty. The format of the returned string is arbitrary and should not be parsed.
- class edlio.EDLDataset(name=None)#
Bases:
EDLUnit
An EDL Dataset
- __init__(name=None)#
Create a new EDL dataset.
If the dataset has no name and path set, it can not be saved to disk.
- Parameters:
name – Name of this dataset, or None
- add_aux_data(adf)#
- property aux_data: list[EDLDataFile]#
- property data: EDLDataFile#
- load(path, mf=None)#
Load an EDL dataset from a path.
- read_aux_data(key=None)#
Read auxiliary data from this dataset.
- Parameters:
key (
Optional
[str
]) – Identifier key for the auxiliary dataset to load. Will look for a substring match in file_type/media_type properties of the data first, then look for a summary text match to determine which data was requested. If not set, the first dataset is loaded.- Return type:
The data, or None in case no aux-data or aux-data entry was found.
- read_data(**kwargs)#
Read data from this dataset.
Returns a generator to read data from this dataset by individual chunks, taking auxiliary data into account.
- save()#
Save dataset changes to their current location on disk.
- exception edlio.EDLError(message)#
Bases:
Exception
Exception raised for errors in the input.
- Attributes:
message – explanation of the error
- class edlio.EDLGroup(name=None)#
Bases:
EDLUnit
An EDL Group
- __init__(name=None)#
Create a new EDL group.
If the group has no name and path set, it can not be saved to disk.
- Parameters:
name (
str
) – Name of this group, or None
- add_child(child)#
- change_name(new_name)#
- property children#
- dataset_by_name(name, *, create=False)#
- property datasets#
- group_by_name(name, *, create=False)#
- property groups#
- load(path, mf=None)#
Load an EDL unit from a path or path/data combination.
- Parameters:
path – Filesystem path of this dataset.
mf – Manifest file data as dictionary, if data from :path should not be used.
- save()#
- edlio.load(path)#
Open an EDL unit via its filesystem path.
This function will read an EDL unit on the filesystem and return an object representing it. Depending on the type of the EDL unit, the returned datatype may be a collection, group or dataset.
Submodules#
edlio.collection module#
- class edlio.collection.EDLCollection(name=None)#
Bases:
EDLGroup
An EDL Collection
- __init__(name=None)#
Create a new EDL collection.
If the collection has no name and path set, it can not be saved to disk.
- Parameters:
name – Name of this collection, or None
- property collection_idname: str#
Retrieve a human-readable string for this collection which is most likely (but not guaranteed to be) unique. If this collection has no properties set, the value of this property may be None or empty. The format of the returned string is arbitrary and should not be parsed.
edlio.dataset module#
- class edlio.dataset.EDLDataFile(base_path, media_type=None, file_type=None, unit_attrs=None)#
Bases:
object
A data file, associated with a dataset
- property data_type#
- new_part(fname, index=-1, *, allow_exists=False)#
- part_paths()#
Return a generator for the path of each file-part, in their correct sorting order.
-
parts:
list
[EDLDataPart
] = []#
- read(aux_data_entries=None, **kwargs)#
Read all data parts in this set.
This returns a generator which reads all the individual data parts in this data file. The data reader may take auxiliary data into account, if :aux_data is passed.
- class edlio.dataset.EDLDataPart(fname, index=-1)#
Bases:
object
Describes a part of a data file that has been split
- class edlio.dataset.EDLDataset(name=None)#
Bases:
EDLUnit
An EDL Dataset
- __init__(name=None)#
Create a new EDL dataset.
If the dataset has no name and path set, it can not be saved to disk.
- Parameters:
name – Name of this dataset, or None
- add_aux_data(adf)#
- property aux_data: list[EDLDataFile]#
- property data: EDLDataFile#
- load(path, mf=None)#
Load an EDL dataset from a path.
- read_aux_data(key=None)#
Read auxiliary data from this dataset.
- Parameters:
key (
Optional
[str
]) – Identifier key for the auxiliary dataset to load. Will look for a substring match in file_type/media_type properties of the data first, then look for a summary text match to determine which data was requested. If not set, the first dataset is loaded.- Return type:
The data, or None in case no aux-data or aux-data entry was found.
- read_data(**kwargs)#
Read data from this dataset.
Returns a generator to read data from this dataset by individual chunks, taking auxiliary data into account.
- save()#
Save dataset changes to their current location on disk.
edlio.group module#
- class edlio.group.EDLGroup(name=None)#
Bases:
EDLUnit
An EDL Group
- __init__(name=None)#
Create a new EDL group.
If the group has no name and path set, it can not be saved to disk.
- Parameters:
name (
str
) – Name of this group, or None
- add_child(child)#
- change_name(new_name)#
- property children#
- dataset_by_name(name, *, create=False)#
- property datasets#
- group_by_name(name, *, create=False)#
- property groups#
- load(path, mf=None)#
Load an EDL unit from a path or path/data combination.
- Parameters:
path – Filesystem path of this dataset.
mf – Manifest file data as dictionary, if data from :path should not be used.
- save()#
edlio.unit module#
- exception edlio.unit.EDLError(message)#
Bases:
Exception
Exception raised for errors in the input.
- Attributes:
message – explanation of the error