lazydata/config/config.py
def add_file_entry(self, path:str, script_path:str, source_url: Optional[str] = None) -> Dict[str, str]:
        """
        Add a file entry to the config file

        :param path: The path to the data file
        :param script_path: The path to the script that used it
        :param source_url: The source to download file from
        :return:
        """
        # path relative to the config file
        path_rel = str(self.path_relative_to_config(path))
        script_path_rel = str(self.path_relative_to_config(script_path))

        sha256 = calculate_file_sha256(path)

        result = {
            "path": path_rel,
            "hash": sha256,
            "usage": script_path_rel,
        }
        if source_url is not None:
            result['source_url'] = source_url
        self.config["files"].append(result)

        self.save_config()

        return result

        Add a file entry to the config file

        :param path: The path to the data file
        :param script_path: The path to the script that used it
        :param source_url: The source to download file from
        :return:
        
Add a file entry to the config file
Add a file entry to the config file
def add_file_entry(self, path:str, script_path:str, source_url: Optional[str] = None) -> Dict[str, str]:
        path_rel = str(self.path_relative_to_config(path))
        script_path_rel = str(self.path_relative_to_config(script_path))
        sha256 = calculate_file_sha256(path)
        result = {
            "path": path_rel,
            "hash": sha256,
            "usage": script_path_rel,
        }
        if source_url is not None:
            result['source_url'] = source_url
        self.config["files"].append(result)
        self.save_config()
        return result
def add_file_entry ( self , path : str , script_path : str , source_url : Optional [ str ] = None ) -> Dict [ str , str ] : path_rel = str ( self . path_relative_to_config ( path ) ) script_path_rel = str ( self . path_relative_to_config ( script_path ) ) sha256 = calculate_file_sha256 ( path ) result = { "path" : path_rel , "hash" : sha256 , "usage" : script_path_rel , } if source_url is not None : result [ 'source_url' ] = source_url self . config [ "files" ] . append ( result ) self . save_config ( ) return result
Add a file entry to the config file
Add a file entry to the config file
"""
        Add a file entry to the config file

        :param path: The path to the data file
        :param script_path: The path to the script that used it
        :param source_url: The source to download file from
        :return:
        """ # path relative to the config file
None
self
path
str
The path to the data file
The path to the data file
script_path
str
The path to the script that used it
The path to the script that used it
source_url
Optional[str]
The source to download file from
The source to download file from