FileReference class¶
FileReference objects are used to bundle together the file path, size and download token of a specific file. They are typically automatically created and placed in a FileReferenceList by methods of classes inheriting from GWDCObjectBase.
FileReferenceList class¶
FileReferenceList objects bundle together many FileReference objects, allowing simpler downloading and filtering of multiple files. As with FileReference objects, FileReferenceList objects are normally created by other methods.
- class gwdc_python.files.file_reference.FileReferenceList(data=[])¶
Bases:
gwdc_python.utils.typed_list.TypedList- property batched¶
- filter_list(file_filter_fn, *args, **kwargs)¶
Create a subset of this list by filtering the contents with a function.
- Parameters
file_filter_fn (function) – Must take a list of FileReference objects and return only those that are desired
- Returns
Filtered list
- Return type
- filter_list_by_path(directory=None, name=None, extension=None)¶
Create a subset of this list by filtering the contents based on their path attributes
- Parameters
- Returns
Filtered list
- Return type
- get_parent_type()¶
Get the storage type for each parent in a list
- Returns
List of GWDCObjectType for each parent of the files in the list
- Return type
- get_tokens()¶
Get all the download tokens in a list
- Returns
List of download tokens
- Return type