pyiron_base.storage.filedata module
Generic File Object.
- class pyiron_base.storage.filedata.FileData(file, data=None, metadata=None, filetype=None, pyiron_project=None)
Bases:
FileDataTemplate
FileData stores an instance of a data file, e.g. a single Image from a measurement.
- property data
Return the associated data.
- class pyiron_base.storage.filedata.FileDataTemplate
Bases:
ABC
- abstract property data
Return the associated data.
- class pyiron_base.storage.filedata.FileLoader
Bases:
object
- default_assumed_file_type = '.txt'
- load(file_type, file, *args, **kwargs)
- classmethod register(file_type, load_callable)
Register a load function for a specific file type.
- Parameters:
file_type (str) – File extension to be registered, e.g. ‘.txt’, ‘.csv’
load_callable (callable) – function excepting a file or file-handle, returning an appropriate object for this file type.
- class pyiron_base.storage.filedata.OwnNotebookNode(*args, **kw)
Bases:
NotebookNode
Wrapper for nbformat.NotebookNode with some additional representation based on nbconvert.
- pyiron_base.storage.filedata.load_file(fp, filetype=None, project=None)
Load the file and return an appropriate object containing the data.
- Parameters:
fp (str / file) – path to the file or file object to be displayed.
filetype (str/None) – File extension, if given this overwrites the assumption based on the filename.
project (pyiron-Project/None) – Project calling this function, provided to all objects referring to such.
are (Supported file types)
'.h5'
'.hdf'
'.json'
'.txt'
'.csv'
'.ipynb'
PIL (Image extensions supported by)
- Returns:
pointing to the file of filetype = ‘.h5’ dict/list: containing data from file of filetype = ‘.json’ list: of all lines from file for filetype = ‘.txt’
pandas.DataFrame
: containing data from file of filetype = ‘.csv’- Return type:
FileHDFio
/ProjectHDFio