Last active
May 26, 2021 15:34
-
-
Save vlad-ds/9c6a467770bc837cb92ddc76b399ba8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
from typing import List | |
from os import listdir | |
def get_streamings(path: str = 'MyData') -> List[dict]: | |
files = ['MyData/' + x for x in listdir(path) | |
if x.split('.')[0][:-1] == 'StreamingHistory'] | |
all_streamings = [] | |
for file in files: | |
with open(file, 'r', encoding='UTF-8') as f: | |
new_streamings = ast.literal_eval(f.read()) | |
all_streamings += [streaming for streaming | |
in new_streamings] | |
return all_streamings | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment