def create_csv_file(insights):
    current_date = datetime.datetime.now()
    current_date_format = current_date.strftime('%m-%d-%Y-%Hh%M')
    current_date_format_string = str(current_date_format)
    filename = (('zup-insights-' + current_date_format_string) + '.csv')
    file = open(filename, 'w+', newline='')
    with file:
        header = ['Repository', 'Views (14d)', 'Uniques (14d)', 'Clones (14d)', 'Contributors', 'Forks', 'Stars', 'Watchers']
        writer = csv.DictWriter(file, fieldnames=header)
        writer.writeheader()
    file = open(filename, 'a+', newline='')
    with file:
        for insight in insights:
            data = [[insight['repo'], insight['views'], insight['uniques'], insight['clones'], insight['contributors'], insight['forks'], insight['stars'], insight['watchers']]]
            write = csv.writer(file)
            write.writerows(data)
    print(f'''
[1m✅ Successfully generated [4m{filename}[0m[1m file for ZupIT's repositories[0m''')
def create_csv_file(insights):
    current_date = datetime.datetime.now()
    current_date_format = current_date.strftime('%m-%d-%Y-%Hh%M')
    current_date_format_string = str(current_date_format)
    filename = (('zup-insights-' + current_date_format_string) + '.csv')
    file = open(filename, 'w+', newline=)
    with file:
        header = ['Repository', 'Views (14d)', 'Uniques (14d)', 'Clones (14d)', 'Contributors', 'Forks', 'Stars', 'Watchers']
        writer = csv.DictWriter(file, fieldnames=header)
        writer.writeheader()
    file = open(filename, 'a+', newline=)
    with file:
        for insight in insights:
            data = [[insight['repo'], insight['views'], insight['uniques'], insight['clones'], insight['contributors'], insight['forks'], insight['stars'], insight['watchers']]]
            write = csv.writer(file)
            write.writerows(data)
    print(f'
[1m✅ Successfully generated [4m{filename}[0m[1m file for ZupIT's repositories[0m')