aboutsummaryrefslogtreecommitdiff
path: root/libs/decompressor.py
diff options
context:
space:
mode:
Diffstat (limited to 'libs/decompressor.py')
-rw-r--r--libs/decompressor.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/decompressor.py b/libs/decompressor.py
new file mode 100644
index 0000000..c54dec9
--- /dev/null
+++ b/libs/decompressor.py
@@ -0,0 +1,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() \ No newline at end of file