We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5809dbd commit 922c4c2Copy full SHA for 922c4c2
wppm/utils.py
@@ -303,6 +303,16 @@ def normalize(this):
303
"""Apply PEP 503 normalization to the string."""
304
return re.sub(r"[-_.]+", "-", this).lower()
305
306
+def zip_directory(folder_path, output_zip_path):
307
+ folder_path = Path(folder_path)
308
+ output_zip_path = Path(output_zip_path)
309
+
310
+ with zipfile.ZipFile(output_zip_path, 'w', compression=zipfile.ZIP_DEFLATED) as zipf:
311
+ for file in folder_path.rglob('*'):
312
+ if file.is_file():
313
+ arcname = file.relative_to(folder_path)
314
+ zipf.write(file, arcname)
315
316
if __name__ == '__main__':
317
print_box("Test")
318
dname = sys.prefix
0 commit comments