[docs]classFileBuffer:''' Class holds the file content with goal to delivery it to the execution side in case of remote executions. The basic implementation reads file content to a property that allows to transfer file content as pickled object to the server side since the pickling stores all class property values. '''def__init__(self,path:Union[str,os.PathLike]):content=Path(path).read_text()self._content=zlib.compress(content.encode('utf-8'),level=9)defget(self):''' Returns file content '''returnzlib.decompress(self._content).decode('utf-8')
[docs]deffile(path:Union[str,os.PathLike])->FileBuffer:''' Helps to build a file buffer that could be used to delivery on the remote site to be processed there. For example it coulld be passed as input to the :class:`CSV <onetick.py.CSV>` See Also -------- :class:`CSV <onetick.py.CSV>` '''returnFileBuffer(path)