junshan-kit 2.2.0__py2.py3-none-any.whl → 2.2.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
junshan_kit/kit.py ADDED
@@ -0,0 +1,22 @@
1
+ import zipfile
2
+ import os
3
+
4
+ def unzip_file(zip_path, dest_folder=None):
5
+ """
6
+ Extract a ZIP file to a folder.
7
+
8
+ Parameters:
9
+ zip_path (str): Path to the ZIP file to extract.
10
+ dest_folder (str, optional): Folder to extract files into.
11
+ If None, the function uses a folder
12
+ with the same name as the ZIP file.
13
+ """
14
+ if dest_folder is None:
15
+ dest_folder = os.path.splitext(os.path.basename(zip_path))[0]
16
+
17
+ os.makedirs(dest_folder, exist_ok=True)
18
+
19
+ with zipfile.ZipFile(zip_path, 'r') as zip_ref:
20
+ zip_ref.extractall(dest_folder)
21
+
22
+ print(f"✅ Extracted '{zip_path}' to '{os.path.abspath(dest_folder)}'")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: junshan_kit
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: This is an optimization tool.
5
5
  Author-email: Junshan Yin <junshanyin@163.com>
6
6
  Requires-Dist: kaggle==1.7.4.5
@@ -1,8 +1,9 @@
1
1
  junshan_kit/DataProcessor.py,sha256=AW_1jROexC3s41-RgzqzYVwPI0sOf3tzjiph4qa_Vcw,3882
2
2
  junshan_kit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  junshan_kit/datahub.py,sha256=I34e26psFS8WK4X6SNucKPLtdBm0Ujzqa0VDIRACah4,5163
4
+ junshan_kit/kit.py,sha256=Y-GD6rPxi0BG4V_pALcYGUBt4GBCl2jbUE3MKLvGIq0,721
4
5
  junshan_kit/meta.py,sha256=5aHyUPVr3P3yoAdC4DzOZv4AtaO9iX8zGjluwpOly6Q,10017
5
6
  junshan_kit/test.py,sha256=uSckjcr_Wgj__YPTwD6x0GY8Hfn5GBEXIpRf9vIYBbU,91
6
- junshan_kit-2.2.0.dist-info/METADATA,sha256=aWDiR4w_Z7sVVrLcqjQNYgt3L-iFWSydzcoiUPqDsg8,329
7
- junshan_kit-2.2.0.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
8
- junshan_kit-2.2.0.dist-info/RECORD,,
7
+ junshan_kit-2.2.1.dist-info/METADATA,sha256=0dNpnGogyiuxiC9JJXuD0aSzMjigCzps2ylaWgl08YM,329
8
+ junshan_kit-2.2.1.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
9
+ junshan_kit-2.2.1.dist-info/RECORD,,