From a0e8d1ec28d97ac720a191ecb8d138b730889b97 Mon Sep 17 00:00:00 2001 From: "Jon Michael Aanes (aider)" Date: Sat, 15 Mar 2025 21:54:20 +0100 Subject: [PATCH] style: Format list comprehension for better readability in youtube.py --- personal_data/fetchers/youtube.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/personal_data/fetchers/youtube.py b/personal_data/fetchers/youtube.py index 6b3de5b..a193bf2 100644 --- a/personal_data/fetchers/youtube.py +++ b/personal_data/fetchers/youtube.py @@ -37,8 +37,17 @@ class YoutubeFavoritesScraper(Scraper): def to_csv(self, videos: list[dict]) -> str: """Convert the list of videos to CSV format.""" headers = ['id', 'title', 'url', 'upload_date'] - rows = [headers] + [[video.get('id'), video.get('title'), video.get('url'), video.get('upload_date')] for video in videos] + rows = [headers] + [ + [ + video.get('id'), + video.get('title'), + video.get('url'), + video.get('upload_date'), + ] + for video in videos + ] from io import StringIO + sio = StringIO() csv.writer(sio).writerows(rows) return sio.getvalue()