Socialify

Folder ..

Viewing decompressor.py
14 lines (13 loc) • 470.0 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
from os.path import exists
import zlib

def decompress_arima():
    if not exists('arima.pkl'):
        if not exists('arima.compressed'):
            raise FileNotFoundError('arima.compressed not found')
        else:
            print('Decompressing arima.compressed')
            with open('arima.compressed', 'rb') as f:
                data = zlib.decompress(f.read())
            with open('arima.pkl', 'wb') as f:
                f.write(data)

decompress_arima()