libs/io_lib.py
def unarchive_object(filename:str, ext:str=None):
    """[Unarchive a Python object from a dump file]

    Args:
        filename (str): [filename]
        ext (str, optional): [file extension]. Defaults to 'dmp'.

    Returns:
        [type]: [Unarchived python object]
    """
    if '.' in filename and ext is None:
        ext = filename.split('.')[-1]
        filename = filename.replace("." + ext,'')
    if ext is None:
        ext = 'dmp'
    if ext is not None and pathlib.Path(filename).suffix == '':
        filename = filename + '.' + ext
    object_to_get = None
    if os.path.exists(filename):
        with open(filename, 'rb') as f:
            try:
                object_to_get     = pickle.load(f)
            except Exception as ex:
                print(ex)
    return object_to_get
[Unarchive a Python object from a dump file]

    Args:
        filename (str): [filename]
        ext (str, optional): [file extension]. Defaults to 'dmp'.

    Returns:
        [type]: [Unarchived python object]
    
[Unarchive a Python object from a dump file]
[ Unarchive a Python object from a dump file ]
def unarchive_object(filename:str, ext:str=None):
    if '.' in filename and ext is None:
        ext = filename.split('.')[-1]
        filename = filename.replace("." + ext,'')
    if ext is None:
        ext = 'dmp'
    if ext is not None and pathlib.Path(filename).suffix == '':
        filename = filename + '.' + ext
    object_to_get = None
    if os.path.exists(filename):
        with open(filename, 'rb') as f:
            try:
                object_to_get     = pickle.load(f)
            except Exception as ex:
                print(ex)
    return object_to_get
def unarchive_object ( filename : str , ext : str = None ) : if '.' in filename and ext is None : ext = filename . split ( '.' ) [ - 1 ] filename = filename . replace ( "." + ext , '' ) if ext is None : ext = 'dmp' if ext is not None and pathlib . Path ( filename ) . suffix == '' : filename = filename + '.' + ext object_to_get = None if os . path . exists ( filename ) : with open ( filename , 'rb' ) as f : try : object_to_get = pickle . load ( f ) except Exception as ex : print ( ex ) return object_to_get
[Unarchive a Python object from a dump file]
[ Unarchive a Python object from a dump file ]
"""[Unarchive a Python object from a dump file]

    Args:
        filename (str): [filename]
        ext (str, optional): [file extension]. Defaults to 'dmp'.

    Returns:
        [type]: [Unarchived python object]
    """
[Unarchived python object]
[ Unarchived python object ]
[type]
filename
str
None
ext
str
[file extension]. Defaults to 'dmp'.
[ file extension ] . Defaults to ' dmp ' .
'dmp'