aboutsummaryrefslogtreecommitdiff
path: root/libs/decompressor.py
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2021-12-09 03:01:49 -0500
committerPriyansh <[email protected]>2021-12-09 03:01:49 -0500
commit3b48c04470e2c368ba18716bb789b40942d6989f (patch)
tree1cb97d5271f2233fbf9d0ef864b91fc8a61efb17 /libs/decompressor.py
parent22e1d761027501bfa59b92776cf1c13eef3a0004 (diff)
downloadtemp_pred_arima-3b48c04470e2c368ba18716bb789b40942d6989f.tar.xz
temp_pred_arima-3b48c04470e2c368ba18716bb789b40942d6989f.zip
changed project structure
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