src/extractor-lib/edfi_lms_extractor_lib/csv_generation/write.py
def _write_csv(df_to_write: DataFrame, output_date: datetime, directory: str):
    """
    Write a LMS UDM DataFrame to a CSV file

    Parameters
    ----------
    df_to_write: DataFrame
        is a LMS UDM DataFrame
    output_date: datetime
        is the timestamp for the filename
    directory: str
        is the directory the file will go in
    """
    filename: str = output_date.strftime("%Y-%m-%d-%H-%M-%S")
    path = os.path.join(directory, f"{filename}.csv")

    try:
        os.makedirs(directory, exist_ok=True)
        df_to_write.to_csv(path, index=False)

        logger.info(f"Generated file => {path}")
    except Exception:
        logger.exception("An exception occurred while writing file %s", path)

    Write a LMS UDM DataFrame to a CSV file

    Parameters
    ----------
    df_to_write: DataFrame
        is a LMS UDM DataFrame
    output_date: datetime
        is the timestamp for the filename
    directory: str
        is the directory the file will go in
    
Write a LMS UDM DataFrame to a CSV file
Parameters

DataFrame
is a LMS UDM DataFrame
output_date: datetime
is the timestamp for the filename
directory: str
is the directory the file will go in
Write a LMS UDM DataFrame to a CSV file Parameters DataFrame is a LMS UDM DataFrame output_date : datetime is the timestamp for the filename directory : str is the directory the file will go in
def _write_csv(df_to_write: DataFrame, output_date: datetime, directory: str):
    filename: str = output_date.strftime("%Y-%m-%d-%H-%M-%S")
    path = os.path.join(directory, f"{filename}.csv")
    try:
        os.makedirs(directory, exist_ok=True)
        df_to_write.to_csv(path, index=False)
        logger.info(f"Generated file => {path}")
    except Exception:
        logger.exception("An exception occurred while writing file %s", path)
def _write_csv ( df_to_write : DataFrame , output_date : datetime , directory : str ) : filename : str = output_date . strftime ( "%Y-%m-%d-%H-%M-%S" ) path = os . path . join ( directory , f"{filename}.csv" ) try : os . makedirs ( directory , exist_ok = True ) df_to_write . to_csv ( path , index = False ) logger . info ( f"Generated file => {path}" ) except Exception : logger . exception ( "An exception occurred while writing file %s" , path )
Write a LMS UDM DataFrame to a CSV file
Parameters
Write a LMS UDM DataFrame to a CSV file Parameters
"""
    Write a LMS UDM DataFrame to a CSV file

    Parameters
    ----------
    df_to_write: DataFrame
        is a LMS UDM DataFrame
    output_date: datetime
        is the timestamp for the filename
    directory: str
        is the directory the file will go in
    """
df_to_write
DataFrame
output_date
datetime
directory
str