halib 0.1.49__py3-none-any.whl → 0.1.50__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.
- halib/__init__.py +12 -1
- halib/common.py +25 -5
- {halib-0.1.49.dist-info → halib-0.1.50.dist-info}/METADATA +162 -156
- {halib-0.1.49.dist-info → halib-0.1.50.dist-info}/RECORD +7 -7
- {halib-0.1.49.dist-info → halib-0.1.50.dist-info}/WHEEL +1 -1
- {halib-0.1.49.dist-info → halib-0.1.50.dist-info}/LICENSE.txt +0 -0
- {halib-0.1.49.dist-info → halib-0.1.50.dist-info}/top_level.txt +0 -0
halib/__init__.py
CHANGED
@@ -21,7 +21,9 @@ __all__ = [
|
|
21
21
|
"plt",
|
22
22
|
"pprint",
|
23
23
|
"pprint_box",
|
24
|
+
"pprint_local_path",
|
24
25
|
"px",
|
26
|
+
"pprint_local_path",
|
25
27
|
"rcolor_all_str",
|
26
28
|
"rcolor_palette_all",
|
27
29
|
"rcolor_palette",
|
@@ -36,6 +38,7 @@ __all__ = [
|
|
36
38
|
"time",
|
37
39
|
]
|
38
40
|
import warnings
|
41
|
+
|
39
42
|
warnings.filterwarnings("ignore", message="Unable to import Axes3D")
|
40
43
|
|
41
44
|
# common libraries
|
@@ -54,7 +57,15 @@ from .system import cmd
|
|
54
57
|
from .system import filesys as fs
|
55
58
|
from .filetype import csvfile
|
56
59
|
from .cuda import tcuda
|
57
|
-
from .common import
|
60
|
+
from .common import (
|
61
|
+
console,
|
62
|
+
console_log,
|
63
|
+
ConsoleLog,
|
64
|
+
now_str,
|
65
|
+
norm_str,
|
66
|
+
pprint_box,
|
67
|
+
pprint_local_path,
|
68
|
+
)
|
58
69
|
|
59
70
|
# for log
|
60
71
|
from loguru import logger
|
halib/common.py
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
-
import arrow
|
2
1
|
import re
|
2
|
+
import rich
|
3
|
+
import arrow
|
4
|
+
import pathlib
|
5
|
+
from pathlib import Path
|
6
|
+
import urllib.parse
|
7
|
+
|
8
|
+
from rich import print
|
9
|
+
from rich.panel import Panel
|
3
10
|
from rich.console import Console
|
4
11
|
from rich.pretty import pprint, Pretty
|
5
|
-
from rich.panel import Panel
|
6
|
-
import rich
|
7
12
|
|
8
13
|
console = Console()
|
9
14
|
|
10
|
-
|
11
15
|
def seed_everything(seed=42):
|
12
16
|
import random
|
13
17
|
import numpy as np
|
@@ -54,7 +58,6 @@ def pprint_box(obj, title="", border_style="green"):
|
|
54
58
|
Panel(Pretty(obj, expand_all=True), title=title, border_style=border_style)
|
55
59
|
)
|
56
60
|
|
57
|
-
|
58
61
|
def console_rule(msg, do_norm_msg=True, is_end_tag=False):
|
59
62
|
msg = norm_str(msg) if do_norm_msg else msg
|
60
63
|
if is_end_tag:
|
@@ -86,3 +89,20 @@ class ConsoleLog:
|
|
86
89
|
if exc_type is not None:
|
87
90
|
print(f"An exception of type {exc_type} occurred.")
|
88
91
|
print(f"Exception message: {exc_value}")
|
92
|
+
|
93
|
+
|
94
|
+
def pprint_local_path(local_path, tag=""):
|
95
|
+
# Create a file URI
|
96
|
+
file_path = Path(local_path).resolve()
|
97
|
+
is_file = file_path.is_file()
|
98
|
+
is_dir = file_path.is_dir()
|
99
|
+
type_str = "📄" if is_file else "📁" if is_dir else "❓"
|
100
|
+
file_uri = file_path.as_uri()
|
101
|
+
content_str = f"{type_str} [link={file_uri}]{file_uri}[/link]"
|
102
|
+
if isinstance(tag, str) and len(tag) > 0:
|
103
|
+
with ConsoleLog(tag):
|
104
|
+
console.print(content_str)
|
105
|
+
else:
|
106
|
+
# If tag is not provided, just print the link
|
107
|
+
console.print(f"{content_str}")
|
108
|
+
return file_uri
|
@@ -1,156 +1,162 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: halib
|
3
|
-
Version: 0.1.
|
4
|
-
Summary: Small library for common tasks
|
5
|
-
Author: Hoang Van Ha
|
6
|
-
Author-email: hoangvanhauit@gmail.com
|
7
|
-
|
8
|
-
|
9
|
-
Classifier:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
Requires-Dist:
|
16
|
-
Requires-Dist:
|
17
|
-
Requires-Dist:
|
18
|
-
Requires-Dist:
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
21
|
-
Requires-Dist:
|
22
|
-
Requires-Dist:
|
23
|
-
Requires-Dist:
|
24
|
-
Requires-Dist:
|
25
|
-
Requires-Dist:
|
26
|
-
Requires-Dist:
|
27
|
-
Requires-Dist:
|
28
|
-
Requires-Dist:
|
29
|
-
Requires-Dist:
|
30
|
-
Requires-Dist:
|
31
|
-
Requires-Dist:
|
32
|
-
Requires-Dist:
|
33
|
-
Requires-Dist:
|
34
|
-
Requires-Dist:
|
35
|
-
Requires-Dist:
|
36
|
-
Requires-Dist:
|
37
|
-
Requires-Dist:
|
38
|
-
Requires-Dist:
|
39
|
-
Requires-Dist:
|
40
|
-
Requires-Dist:
|
41
|
-
Requires-Dist:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
+ add `
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
+
|
56
|
-
|
57
|
-
**Version 0.1.
|
58
|
-
+
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
+
|
66
|
-
|
67
|
-
**Version 0.1.
|
68
|
-
|
69
|
-
+
|
70
|
-
|
71
|
-
**Version 0.1.
|
72
|
-
|
73
|
-
+ add <
|
74
|
-
|
75
|
-
**Version 0.1.
|
76
|
-
|
77
|
-
+
|
78
|
-
---
|
79
|
-
**Version 0.1.
|
80
|
-
|
81
|
-
+
|
82
|
-
---
|
83
|
-
**Version 0.1.
|
84
|
-
|
85
|
-
+
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
+ add `
|
91
|
-
---
|
92
|
-
**Version 0.1.
|
93
|
-
|
94
|
-
+
|
95
|
-
---
|
96
|
-
**Version 0.1.
|
97
|
-
|
98
|
-
+ `
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
+
|
110
|
-
|
111
|
-
**Version 0.1.
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: halib
|
3
|
+
Version: 0.1.50
|
4
|
+
Summary: Small library for common tasks
|
5
|
+
Author: Hoang Van Ha
|
6
|
+
Author-email: hoangvanhauit@gmail.com
|
7
|
+
License: UNKNOWN
|
8
|
+
Platform: UNKNOWN
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
11
|
+
Classifier: Operating System :: OS Independent
|
12
|
+
Requires-Python: >=3.8
|
13
|
+
Description-Content-Type: text/markdown
|
14
|
+
License-File: LICENSE.txt
|
15
|
+
Requires-Dist: arrow
|
16
|
+
Requires-Dist: click
|
17
|
+
Requires-Dist: enlighten
|
18
|
+
Requires-Dist: kaleido (==0.1.*)
|
19
|
+
Requires-Dist: loguru
|
20
|
+
Requires-Dist: more-itertools
|
21
|
+
Requires-Dist: moviepy
|
22
|
+
Requires-Dist: networkx
|
23
|
+
Requires-Dist: numpy
|
24
|
+
Requires-Dist: omegaconf
|
25
|
+
Requires-Dist: opencv-python
|
26
|
+
Requires-Dist: pandas
|
27
|
+
Requires-Dist: Pillow
|
28
|
+
Requires-Dist: Pyarrow
|
29
|
+
Requires-Dist: pycurl
|
30
|
+
Requires-Dist: python-telegram-bot
|
31
|
+
Requires-Dist: requests
|
32
|
+
Requires-Dist: rich
|
33
|
+
Requires-Dist: scikit-learn
|
34
|
+
Requires-Dist: matplotlib
|
35
|
+
Requires-Dist: seaborn
|
36
|
+
Requires-Dist: plotly
|
37
|
+
Requires-Dist: pygwalker
|
38
|
+
Requires-Dist: tabulate
|
39
|
+
Requires-Dist: itables
|
40
|
+
Requires-Dist: timebudget
|
41
|
+
Requires-Dist: tqdm
|
42
|
+
Requires-Dist: tube-dl
|
43
|
+
Requires-Dist: wandb
|
44
|
+
|
45
|
+
Helper package for coding and automation
|
46
|
+
|
47
|
+
**Version 0.1.50**
|
48
|
+
|
49
|
+
+ add `pprint_local_path` to print local path (file/directory) in clickable link (as file URI)
|
50
|
+
|
51
|
+
+ add `research` package to help with research tasks, including `benchquery` for benchmarking queries from dataframe
|
52
|
+
+ add `wandb` module to allow easy sync offline data to Weights & Biases (wandb) and batch clear wandb runs.
|
53
|
+
|
54
|
+
**Version 0.1.47**
|
55
|
+
+ add `pprint_box` to print object/string in a box frame (like in `inspect`)
|
56
|
+
|
57
|
+
**Version 0.1.46**
|
58
|
+
+ filter the warning message of `UserWarning: Unable to import Axes3D.`
|
59
|
+
+ auto_wrap_text for `fn_display_df` to avoid long text in the table
|
60
|
+
|
61
|
+
**Version 0.1.42**
|
62
|
+
+ add <rich_color.py>: add basic color list (for easy usage)
|
63
|
+
|
64
|
+
**Version 0.1.41**
|
65
|
+
+ add <rich_color.py> to display rich color information in <rich> python package (rcolor_str, rcolor_pallet_all, etc.)
|
66
|
+
|
67
|
+
**Version 0.1.40**
|
68
|
+
|
69
|
+
+ update <csvfile.py> to use `itables` and `pygwalker` to display dataframe in jupyter notebook.
|
70
|
+
|
71
|
+
**Version 0.1.38**
|
72
|
+
|
73
|
+
+ add <torchloader.py> to search for best cfg for torch dataloader (num_workers, batch_size, pin_memory, et.)
|
74
|
+
|
75
|
+
**Version 0.1.37**
|
76
|
+
|
77
|
+
+ add <dataset.py> to help split classification dataset into train/val(test)
|
78
|
+
---
|
79
|
+
**Version 0.1.33**
|
80
|
+
|
81
|
+
+ add `plot.py` module to plot DL model training history (with columlns: epoch, train_accuracy, val_accuracy, train_loss, val_loss) using `seaborn` and `matplotlib`
|
82
|
+
---
|
83
|
+
**Version 0.1.29**
|
84
|
+
|
85
|
+
+ for `tele_noti` module, `kaleido==0.1.*` is required for plotly since `kaleido 0.2.*` is not working (taking for ever to generate image)
|
86
|
+
---
|
87
|
+
**Version 0.1.24**
|
88
|
+
|
89
|
+
+ rename `sys` to `system` to avoid conflict with built-in `sys` module
|
90
|
+
+ add `tele_noti` module to send notification to telegram after a specific interval for training progress monitoring
|
91
|
+
---
|
92
|
+
**Version 0.1.22**
|
93
|
+
|
94
|
+
+ add `cuda.py` module to check CUDA availability (for both pytorch and tensorflow)
|
95
|
+
---
|
96
|
+
**Version 0.1.21**
|
97
|
+
|
98
|
+
+ using `networkx` and `omegaconf` to allow yaml file inheritance and override
|
99
|
+
---
|
100
|
+
**Version 0.1.15**
|
101
|
+
|
102
|
+
+ `__init__.py`: add common logging library; also `console_log` decorator to log function (start and end)
|
103
|
+
|
104
|
+
---
|
105
|
+
|
106
|
+
**Version 0.1.10**
|
107
|
+
|
108
|
+
+ filesys: fix typo on "is_exit" to "is_exist"
|
109
|
+
+ gdrive: now support uploading file to folder and return direct link (shareable link)
|
110
|
+
|
111
|
+
**Version 0.1.9**
|
112
|
+
|
113
|
+
+ add dependencies requirement.txt
|
114
|
+
|
115
|
+
**Version 0.1.8**
|
116
|
+
|
117
|
+
Fix bugs:
|
118
|
+
|
119
|
+
+ [performance] instead of inserting directly new rows into table dataframe, first insert it into in-memory `row_pool_dict`, that fill data in that dict into the actual dataframe when needed.
|
120
|
+
|
121
|
+
---
|
122
|
+
|
123
|
+
**Version 0.1.7**
|
124
|
+
|
125
|
+
Fix bugs:
|
126
|
+
|
127
|
+
+ fix insert into table so slow by allowing insert multiple rows at once
|
128
|
+
|
129
|
+
---
|
130
|
+
|
131
|
+
**Version 0.1.6**
|
132
|
+
|
133
|
+
New features:
|
134
|
+
|
135
|
+
+ add DFCreator for manipulating table (DataFrame) - create, insert row, display, write to file
|
136
|
+
|
137
|
+
---
|
138
|
+
|
139
|
+
**Version 0.1.5**
|
140
|
+
|
141
|
+
New Features
|
142
|
+
|
143
|
+
+ add cmd module
|
144
|
+
+ new package structure
|
145
|
+
|
146
|
+
---
|
147
|
+
|
148
|
+
**Version 0.1.4**
|
149
|
+
|
150
|
+
New Features
|
151
|
+
|
152
|
+
+ add support to create Bitbucket Project from template
|
153
|
+
|
154
|
+
---
|
155
|
+
|
156
|
+
**Version 0.1.2**
|
157
|
+
|
158
|
+
New Features
|
159
|
+
|
160
|
+
+ add support to upload local to google drive.
|
161
|
+
|
162
|
+
|
@@ -1,5 +1,5 @@
|
|
1
|
-
halib/__init__.py,sha256=
|
2
|
-
halib/common.py,sha256=
|
1
|
+
halib/__init__.py,sha256=dHuxmYnZjeFT2VXuZU5yKX7c81XqcXX5tsKFtcaxkqI,1657
|
2
|
+
halib/common.py,sha256=ZWKT46IBnXygJIJyy2Mi1PNK_f9GfuppNxYYOrqFAx8,3001
|
3
3
|
halib/csvfile.py,sha256=Eoeni0NIbNG3mB5ESWAvNwhJxOjmCaPd1qqYRHImbvk,1567
|
4
4
|
halib/cuda.py,sha256=1bvtBY8QvTWdLaxalzK9wqXPl0Ft3AfhcrebupxGzEA,1010
|
5
5
|
halib/dataset.py,sha256=QU0Hr5QFb8_XlvnOMgC9QJGIpwXAZ9lDd0RdQi_QRec,6743
|
@@ -42,8 +42,8 @@ halib/system/filesys.py,sha256=ERpnELLDKJoTIIKf-AajgkY62nID4qmqmX5TkE95APU,2931
|
|
42
42
|
halib/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
43
43
|
halib/utils/listop.py,sha256=Vpa8_2fI0wySpB2-8sfTBkyi_A4FhoFVVvFiuvW8N64,339
|
44
44
|
halib/utils/tele_noti.py,sha256=-4WXZelCA4W9BroapkRyIdUu9cUVrcJJhegnMs_WpGU,5928
|
45
|
-
halib-0.1.
|
46
|
-
halib-0.1.
|
47
|
-
halib-0.1.
|
48
|
-
halib-0.1.
|
49
|
-
halib-0.1.
|
45
|
+
halib-0.1.50.dist-info/LICENSE.txt,sha256=qZssdna4aETiR8znYsShUjidu-U4jUT9Q-EWNlZ9yBQ,1100
|
46
|
+
halib-0.1.50.dist-info/METADATA,sha256=resodiH8D_oUSzB_YnE91Z__8oAqIlCErBqkUVRl_Cw,4187
|
47
|
+
halib-0.1.50.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
48
|
+
halib-0.1.50.dist-info/top_level.txt,sha256=7AD6PLaQTreE0Fn44mdZsoHBe_Zdd7GUmjsWPyQ7I-k,6
|
49
|
+
halib-0.1.50.dist-info/RECORD,,
|
File without changes
|
File without changes
|