src/dirbs/reports/csv_reports.py
def _gen_metadata_for_reports(filenames: list, output_dir: str) -> list:
    """
    Function to generate a metadata dictionary for a list file pointer and a passed number of records.

    Arguments:
        filenames: list of file names to generate metadata
        output_dir: path of output directory
    Returns:
        rv: list of metadata dictionaries

    """
    rv = []
    for fn in filenames:
        abs_fn = os.path.join(output_dir, fn)
        file_size = os.stat(abs_fn).st_size
        md5_hash = hashlib.md5()
        md5_hash.update(open(abs_fn, 'rb').read())
        md5sum = md5_hash.hexdigest()
        rv.append({
            'filename': os.path.abspath(abs_fn),
            'md5sum': md5sum,
            'file_size_bytes': file_size
        })
    return rv

    Function to generate a metadata dictionary for a list file pointer and a passed number of records.

    Arguments:
        filenames: list of file names to generate metadata
        output_dir: path of output directory
    Returns:
        rv: list of metadata dictionaries

    
Function to generate a metadata dictionary for a list file pointer and a passed number of records.
Function to generate a metadata dictionary for a list file pointer and a passed number of records .
def _gen_metadata_for_reports(filenames: list, output_dir: str) -> list:
    rv = []
    for fn in filenames:
        abs_fn = os.path.join(output_dir, fn)
        file_size = os.stat(abs_fn).st_size
        md5_hash = hashlib.md5()
        md5_hash.update(open(abs_fn, 'rb').read())
        md5sum = md5_hash.hexdigest()
        rv.append({
            'filename': os.path.abspath(abs_fn),
            'md5sum': md5sum,
            'file_size_bytes': file_size
        })
    return rv
def _gen_metadata_for_reports ( filenames : list , output_dir : str ) -> list : rv = [ ] for fn in filenames : abs_fn = os . path . join ( output_dir , fn ) file_size = os . stat ( abs_fn ) . st_size md5_hash = hashlib . md5 ( ) md5_hash . update ( open ( abs_fn , 'rb' ) . read ( ) ) md5sum = md5_hash . hexdigest ( ) rv . append ( { 'filename' : os . path . abspath ( abs_fn ) , 'md5sum' : md5sum , 'file_size_bytes' : file_size } ) return rv
Function to generate a metadata dictionary for a list file pointer and a passed number of records.
Function to generate a metadata dictionary for a list file pointer and a passed number of records .
"""
    Function to generate a metadata dictionary for a list file pointer and a passed number of records.

    Arguments:
        filenames: list of file names to generate metadata
        output_dir: path of output directory
    Returns:
        rv: list of metadata dictionaries

    """
list of metadata dictionaries
list of metadata dictionaries
rv
filenames
list
list of file names to generate metadata
list of file names to generate metadata
output_dir
str
path of output directory
path of output directory