diff --git a/pycharm/ExtractZippedData.py b/pycharm/ExtractZippedData.py new file mode 100644 index 0000000..9b62760 --- /dev/null +++ b/pycharm/ExtractZippedData.py @@ -0,0 +1,30 @@ +import json +import os +import zipfile +from io import BytesIO + +import pandas as pd + + +def addOneAthlete(df, file): + data = json.load(file) + df = df.append(data, ignore_index=True) + return df + + +def create_pcikle(): + df = pd.DataFrame() + with zipfile.ZipFile('download.zip') as z: + for filename in z.namelist(): + if filename.endswith('.zip'): + zfiledata = BytesIO(z.read(filename)) + with zipfile.ZipFile(zfiledata) as zfile2: + for name2 in zfile2.namelist(): + with zfile2.open(name2) as f: + df = addOneAthlete(df, f) + df.to_pickle('data.pkl') + + +if __name__ == '__main__': + data = pd.read_pickle('data.pkl') + print('x') diff --git a/pycharm/data.pkl b/pycharm/data.pkl new file mode 100644 index 0000000..9724381 Binary files /dev/null and b/pycharm/data.pkl differ diff --git a/pycharm/download.zip b/pycharm/download.zip new file mode 100644 index 0000000..c649f70 Binary files /dev/null and b/pycharm/download.zip differ