How to Flatten a Nested Dictionary in Python
#############################
Video Source: www.youtube.com/watch?v=AOghgzd09lY
How to Flatten a Nested Dictionary in Python","styleRuns":[{"startIndex":0,"length":44,"styleRunExtensions":{"styleRunColorMapExtension":{"colorMap":[{"key":"USER_INTERFACE_THEME_DARK","value":4294967295},{"key":"USER_INTERFACE_THEME_LIGHT","value":4279440147}]}},"fontFamilyName":"Roboto"}]},"headerRuns":[{"startIndex":0,"length":44,"headerMapping":"ATTRIBUTED_STRING_HEADER_MAPPING_UNSPECIFIED"}]}},{"itemSectionRenderer":{"contents":[{"continuationItemRenderer":{"trigger":"CONTINUATION_TRIGGER_ON_ITEM_SHOWN","continuationEndpoint":{"clickTrackingParams":"CL0BELsvGAIiEwi10tW5iOeJAxXEQ3oFHc9gJ2E=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/next"}},"continuationCommand":{"token":"Eg0SC0FPZ2hnemQwOWxZGAYyJSIRIgtBT2doZ3pkMDlsWTAAeAJCEGNvbW1lbnRzLXNlY3Rpb24%3D","request":"CONTINUATION_REQUEST_TYPE_WATCH_NEXT"}}}}],"trackingParams":"CL0BELsvGAIiEwi10tW5iOeJAxXEQ3oFHc9gJ2E=","sectionIdentifier":"comment-item-section","targetId":"comments-section"}}],"trackingParams":"CLwBELovIhMItdLVuYjniQMVxEN6BR3PYCdh"}},"secondaryResults":{"secondaryResults":{"results":[{"compactVideoRenderer":{"videoId":"Hpie63sZdjY","thumbnail":{"thumbnails":[{"url":"https://i.ytimg.com/vi/Hpie63sZdjY/hqdefault.jpg?sqp=-oaymwE1CKgBEF5IVfKriqkDKAgBFQAAiEIYAXABwAEG8AEB-AH-CYAC0AWKAgwIABABGBMgXCh_MA8= rs=AOn4CLAv0if9Rn_j4WRvgdi0g_rYyj-z3w","width":168,"height":94},{"url":"https://i.ytimg.com/vi/Hpie63sZdjY/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGAFwAcABBvABAfgB_gmAAtAFigIMCAAQARgTIFwofzAP rs=AOn4CLBfpBQeGVIzkHledq_T2l2G51RfhQ","width":336,"height":188}]},"title":{"accessibility":{"accessibilityData":{"label":"shell gpt demo автор: Matthew Hopper 15 переглядів 2 тижні тому 1 хвилина і 51 секунда"}},"simpleText":"shell gpt demo"},"longBylineText":{"runs":[{"text":"Matthew Hopper","navigationEndpoint":{"clickTrackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2EyB3JlbGF0ZWQ=","commandMetadata":{"webCommandMetadata":{"url":"/@MatthewHoppermusic","webPageType":"WEB_PAGE_TYPE_CHANNEL","rootVe":3611,"apiUrl":"/youtubei/v1/browse"}},"browseEndpoint":{"browseId":"UCaAJW9Zwco1XIU_bmgwF2Eg","canonicalBaseUrl":"/@MatthewHoppermusic"}}}]},"publishedTimeText":{"simpleText":"2 тижні тому"},"viewCountText":{"simpleText":"15 переглядів"},"lengthText":{"accessibility":{"accessibilityData":{"label":"1 хвилина і 51 секунда"}},"simpleText":"1:51"},"navigationEndpoint":{"clickTrackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2EyB3JlbGF0ZWRI1uzTu7OwiHSaAQUIARD4HQ==","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=Hpie63sZdjY","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"Hpie63sZdjY","nofollow":true,"watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr3---sn-5hne6n6e.googlevideo.com/initplayback?source=youtube oeis=1 c=WEB oad=3200 ovd=3200 oaad=11000 oavd=11000 ocs=700 oewis=1 oputc=1 ofpcc=1 msp=1 odepv=1 id=1e989eeb7b197636 ip=217.12.208.230 mt=1731971836 oweuc="}}}}},"shortBylineText":{"runs":[{"text":"Matthew Hopper","navigationEndpoint":{"clickTrackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2EyB3JlbGF0ZWQ=","commandMetadata":{"webCommandMetadata":{"url":"/@MatthewHoppermusic","webPageType":"WEB_PAGE_TYPE_CHANNEL","rootVe":3611,"apiUrl":"/youtubei/v1/browse"}},"browseEndpoint":{"browseId":"UCaAJW9Zwco1XIU_bmgwF2Eg","canonicalBaseUrl":"/@MatthewHoppermusic"}}}]},"channelThumbnail":{"thumbnails":[{"url":"https://yt3.ggpht.com/RtQiOK301Vj6CtxNTY54ojAgBxpPb0VWeEGSgaxUjAT9ahPYUmdnjWk2sPrZ_BLDFe7l7cU0jw=s68-c-k-c0x00ffffff-no-rj","width":68,"height":68}]},"trackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2FAtuzl2Lfdp8we","shortViewCountText":{"accessibility":{"accessibilityData":{"label":"15 переглядів"}},"simpleText":"15 переглядів"},"menu":{"menuRenderer":{"items":[{"menuServiceItemRenderer":{"text":{"runs":[{"text":"Додати в чергу"}]},"icon":{"iconType":"ADD_TO_QUEUE_TAIL"},"serviceEndpoint":{"clickTrackingParams":"CLoBEP6YBBgFIhMItdLVuYjniQMVxEN6BR3PYCdh","commandMetadata":{"webCommandMetadata":{"sendPost":true}},"signalServiceEndpoint":{"signal":"CLIENT_SIGNAL","actions":[{"clickTrackingParams":"CLoBEP6YBBgFIhMItdLVuYjniQMVxEN6BR3PYCdh","addToPlaylistCommand":{"openMiniplayer":false,"openListPanel":true,"videoId":"Hpie63sZdjY","listType":"PLAYLIST_EDIT_LIST_TYPE_QUEUE","onCreateListCommand":{"clickTrackingParams":"CLoBEP6YBBgFIhMItdLVuYjniQMVxEN6BR3PYCdh","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/playlist/create"}},"createPlaylistServiceEndpoint":{"videoIds":["Hpie63sZdjY"],"params":"CAQ%3D"}},"videoIds":["Hpie63sZdjY"]}},{"clickTrackingParams":"CLoBEP6YBBgFIhMItdLVuYjniQMVxEN6BR3PYCdh","openPopupAction":{"popup":{"notificationActionRenderer":{"responseText":{"simpleText":"Додано до черги"},"trackingParams":"CLsBELlqIhMItdLVuYjniQMVxEN6BR3PYCdh"}},"popupType":"TOAST"}}]}},"trackingParams":"CLoBEP6YBBgFIhMItdLVuYjniQMVxEN6BR3PYCdh"}},{"menuServiceItemDownloadRenderer":{"serviceEndpoint":{"clickTrackingParams":"CLkBENGqBRgGIhMItdLVuYjniQMVxEN6BR3PYCdh","offlineVideoEndpoint":{"videoId":"Hpie63sZdjY","onAddCommand":{"clickTrackingParams":"CLkBENGqBRgGIhMItdLVuYjniQMVxEN6BR3PYCdh","getDownloadActionCommand":{"videoId":"Hpie63sZdjY","params":"CAIQAA%3D%3D"}}}},"trackingParams":"CLkBENGqBRgGIhMItdLVuYjniQMVxEN6BR3PYCdh"}},{"menuServiceItemRenderer":{"text":{"runs":[{"text":"Поділитися"}]},"icon":{"iconType":"SHARE"},"serviceEndpoint":{"clickTrackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2E=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/share/get_share_panel"}},"shareEntityServiceEndpoint":{"serializedShareEntity":"CgtIcGllNjNzWmRqWQ%3D%3D","commands":[{"clickTrackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2E=","openPopupAction":{"popup":{"unifiedSharePanelRenderer":{"trackingParams":"CLgBEI5iIhMItdLVuYjniQMVxEN6BR3PYCdh","showLoadingSpinner":true}},"popupType":"DIALOG","beReused":true}}]}},"trackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2E=","hasSeparator":true}}],"trackingParams":"CLUBEKQwGAAiEwi10tW5iOeJAxXEQ3oFHc9gJ2E=","accessibility":{"accessibilityData":{"label":"Меню дій"}},"targetId":"watch-related-menu-button"}},"thumbnailOverlays":[{"thumbnailOverlayTimeStatusRenderer":{"text":{"accessibility":{"accessibilityData":{"label":"1 хвилина і 51 секунда"}},"simpleText":"1:51"},"style":"DEFAULT"}},{"thumbnailOverlayToggleButtonRenderer":{"isToggled":false,"untoggledIcon":{"iconType":"WATCH_LATER"},"toggledIcon":{"iconType":"CHECK"},"untoggledTooltip":"Переглянути пізніше","toggledTooltip":"Додано","untoggledServiceEndpoint":{"clickTrackingParams":"CLcBEPnnAxgBIhMItdLVuYjniQMVxEN6BR3PYCdh","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/browse/edit_playlist"}},"playlistEditEndpoint":{"playlistId":"WL","actions":[{"addedVideoId":"Hpie63sZdjY","action":"ACTION_ADD_VIDEO"}]}},"toggledServiceEndpoint":{"clickTrackingParams":"CLcBEPnnAxgBIhMItdLVuYjniQMVxEN6BR3PYCdh","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/browse/edit_playlist"}},"playlistEditEndpoint":{"playlistId":"WL","actions":[{"action":"ACTION_REMOVE_VIDEO_BY_VIDEO_ID","removedVideoId":"Hpie63sZdjY"}]}},"untoggledAccessibility":{"accessibilityData":{"label":"Переглянути пізніше"}},"toggledAccessibility":{"accessibilityData":{"label":"Додано"}},"trackingParams":"CLcBEPnnAxgBIhMItdLVuYjniQMVxEN6BR3PYCdh"}},{"thumbnailOverlayToggleButtonRenderer":{"untoggledIcon":{"iconType":"ADD_TO_QUEUE_TAIL"},"toggledIcon":{"iconType":"PLAYLIST_ADD_CHECK"},"untoggledTooltip":"Додати в чергу","toggledTooltip":"Додано","untoggledServiceEndpoint":{"clickTrackingParams":"CLYBEMfsBBgCIhMItdLVuYjniQMVxEN6BR3PYCdh","commandMetadata":{"webCommandMetadata":{"sendPost":true}},"signalServiceEndpoint":{"signal":"CLIENT_SIGNAL","actions":[{"clickTrackingParams":"CLYBEMfsBBgCIhMItdLVuYjniQMVxEN6BR3PYCdh","addToPlaylistCommand":{"openMiniplayer":false,"openListPanel":true,"videoId":"Hpie63sZdjY","listType":"PLAYLIST_EDIT_LIST_TYPE_QUEUE","onCreateListCommand":{"clickTrackingParams":"CLYBEMfsBBgCIhMItdLVuYjniQMVxEN6BR3PYCdh","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/playlist/create"}},"createPlaylistServiceEndpoint":{"videoIds":["Hpie63sZdjY"],"params":"CAQ%3D"}},"videoIds":["Hpie63sZdjY"]}}]}},"untoggledAccessibility":{"accessibilityData":{"label":"Додати в чергу"}},"toggledAccessibility":{"accessibilityData":{"label":"Додано"}},"trackingParams":"CLYBEMfsBBgCIhMItdLVuYjniQMVxEN6BR3PYCdh"}},{"thumbnailOverlayNowPlayingRenderer":{"text":{"runs":[{"text":"Зараз відтворюється"}]}}}],"accessibility":{"accessibilityData":{"label":"shell gpt demo – 1 хвилина і 51 секунда – Перейти до каналу – Matthew Hopper - 15 переглядів - 2 тижні тому – відтворити відео"}},"richThumbnail":{"movingThumbnailRenderer":{"enableHoveredLogging":true,"enableOverlay":true}}}},{"lockupViewModel":{"contentImage":{"collectionThumbnailViewModel":{"primaryThumbnail":{"thumbnailViewModel":{"image":{"sources":[{"url":"https://i.ytimg.com/vi/gGI6dHcDAqM/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ== rs=AOn4CLCWFRlEuy92oICXl8HSLl-kDdiScA","width":168,"height":94},{"url":"https://i.ytimg.com/vi/gGI6dHcDAqM/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE= rs=AOn4CLAPPZoZaDLN9tTvCEdNd6tKULnUyw","width":336,"height":188}]},"overlays":[{"thumbnailOverlayBadgeViewModel":{"thumbnailBadges":[{"thumbnailBadgeViewModel":{"icon":{"sources":[{"clientResource":{"imageName":"PLAYLISTS"}}]},"text":"149 відео","badgeStyle":"THUMBNAIL_OVERLAY_BADGE_STYLE_DEFAULT","backgroundColor":{"lightTheme":1320471,"darkTheme":1320471}}}],"position":"THUMBNAIL_OVERLAY_BADGE_POSITION_BOTTOM_END"}},{"thumbnailHoverOverlayViewModel":{"icon":{"sources":[{"clientResource":{"imageName":"PLAY_ALL"}}]},"text":{"content":"Відтворити все","styleRuns":[{"startIndex":0,"length":14}]},"style":"THUMBNAIL_HOVER_OVERLAY_STYLE_COVER"}}],"backgroundColor":{"lightTheme":2244391,"darkTheme":2244391}}},"stackColor":{"lightTheme":7051635,"darkTheme":7375989}}},"metadata":{"lockupMetadataViewModel":{"title":{"content":"Python Tutorial"},"metadata":{"contentMetadataViewModel":{"metadataRows":[{"metadataParts":[{"text":{"content":"Programming For Beginners
#############################