junshan-kit 2.1.1__py2.py3-none-any.whl → 2.1.2__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/datahub.py CHANGED
@@ -22,7 +22,7 @@ class kaggle_data:
22
22
  # example: list_user_datasets()
23
23
 
24
24
  #---------------------------------------------------------------
25
- def read_data(self, data_name = 'w8a-libsvm', copy_path = None):
25
+ def read_data(self, data_name = 'letter-libsvm', copy_path = None):
26
26
  path = kagglehub.dataset_download(f'junshan888/{data_name}')
27
27
  # print("Downloaded to:", path)
28
28
  if copy_path is not None:
@@ -42,5 +42,12 @@ if __name__ == "__main__":
42
42
  # Example usage
43
43
  print('Available datasets:')
44
44
  data.list_user_datasets()
45
- data.read_data(data_name='w8a-libsvm', copy_path='./exp_data/w')
45
+ data.read_data(data_name='letter-libsvm', copy_path='./exp_data/Letter')
46
+
47
+ """
48
+ import junshan_kit.datahub
49
+ data = junshan_kit.datahub.kaggle_data()
50
+ data.list_user_datasets()
51
+ data.read_data(data_name='letter-libsvm', copy_path='./exp_data/Letter')
52
+ """
46
53
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: junshan_kit
3
- Version: 2.1.1
3
+ Version: 2.1.2
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
@@ -12,6 +12,13 @@ Description-Content-Type: text/markdown
12
12
  - For class kaggle_data in datahub
13
13
  - We need to set API of kaggle.
14
14
 
15
+ ```python
16
+ import junshan_kit.datahub
17
+ data = junshan_kit.datahub.kaggle_data()
18
+ data.list_user_datasets()
19
+ data.read_data(data_name='letter-libsvm', copy_path='./exp_data/Letter')
20
+ ```
21
+
15
22
 
16
23
 
17
24
 
@@ -0,0 +1,5 @@
1
+ junshan_kit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ junshan_kit/datahub.py,sha256=XOIxAox_yue4hbXbrWLSRKQxhMK0tBeHphFmFDp90eU,1659
3
+ junshan_kit-2.1.2.dist-info/METADATA,sha256=wqV_Ci-hw5ZArZl0o6KdYBlZ-L4CBo5-jr2LlMYQBIw,570
4
+ junshan_kit-2.1.2.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
5
+ junshan_kit-2.1.2.dist-info/RECORD,,
junshan_kit/kaggle_hub.py DELETED
@@ -1,38 +0,0 @@
1
- import kagglehub
2
- import os
3
- import shutil
4
- from kaggle.api.kaggle_api_extended import KaggleApi
5
-
6
- def list_user_datasets():
7
- api = KaggleApi()
8
- api.authenticate()
9
-
10
- # Get the list of datasets for a specific user
11
- datasets = api.dataset_list(user='junshan888')
12
-
13
- print('*' * 60)
14
- if datasets is not None:
15
- for ds in datasets:
16
- if ds is not None:
17
- # Print the dataset title
18
- print(ds.title)
19
- print('*' * 60)
20
-
21
- # example: list_user_datasets()
22
-
23
- #---------------------------------------------------------------
24
- def read_data(data_name = 'evpd-test', copy_path = None):
25
- path = kagglehub.dataset_download(f'junshan888/{data_name}')
26
- # print("Downloaded to:", path)
27
- if copy_path is not None:
28
- # Create target directory if it doesn't exist
29
- os.makedirs(copy_path, exist_ok=True)
30
- # Copy dataset to target directory
31
- shutil.copytree(path, copy_path, dirs_exist_ok=True)
32
-
33
- print(f"✅ Dataset has been copied to: {copy_path}/{data_name}")
34
-
35
- # example:
36
- read_data(copy_path='./exp_data')
37
-
38
-
@@ -1,6 +0,0 @@
1
- junshan_kit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- junshan_kit/datahub.py,sha256=jWQSlJOtpaosgoDExx3-UODJBj1-GX1f1TQPEHrCwTU,1448
3
- junshan_kit/kaggle_hub.py,sha256=RYUuUtSY6NgNd0iV8kH5Uxn-eLaJSgUFmi6r33NHPmc,1093
4
- junshan_kit-2.1.1.dist-info/METADATA,sha256=L6QIVQ8TCHZOyKk5gpxtjBFIV5nl8w13ZIrkxUBPBlQ,388
5
- junshan_kit-2.1.1.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
6
- junshan_kit-2.1.1.dist-info/RECORD,,