halib 0.1.45__tar.gz → 0.1.47__tar.gz

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.
Files changed (38) hide show
  1. {halib-0.1.45/halib.egg-info → halib-0.1.47}/PKG-INFO +5 -2
  2. {halib-0.1.45 → halib-0.1.47}/README.md +4 -1
  3. {halib-0.1.45 → halib-0.1.47}/halib/__init__.py +3 -2
  4. {halib-0.1.45 → halib-0.1.47}/halib/common.py +13 -1
  5. {halib-0.1.45 → halib-0.1.47}/halib/filetype/csvfile.py +2 -2
  6. {halib-0.1.45 → halib-0.1.47/halib.egg-info}/PKG-INFO +5 -2
  7. {halib-0.1.45 → halib-0.1.47}/setup.py +1 -1
  8. {halib-0.1.45 → halib-0.1.47}/.gitignore +0 -0
  9. {halib-0.1.45 → halib-0.1.47}/GDriveFolder.txt +0 -0
  10. {halib-0.1.45 → halib-0.1.47}/LICENSE.txt +0 -0
  11. {halib-0.1.45 → halib-0.1.47}/guide_publish_pip.pdf +0 -0
  12. {halib-0.1.45 → halib-0.1.47}/halib/cuda.py +0 -0
  13. {halib-0.1.45 → halib-0.1.47}/halib/dataset.py +0 -0
  14. {halib-0.1.45 → halib-0.1.47}/halib/filetype/__init__.py +0 -0
  15. {halib-0.1.45 → halib-0.1.47}/halib/filetype/jsonfile.py +0 -0
  16. {halib-0.1.45 → halib-0.1.47}/halib/filetype/textfile.py +0 -0
  17. {halib-0.1.45 → halib-0.1.47}/halib/filetype/videofile.py +0 -0
  18. {halib-0.1.45 → halib-0.1.47}/halib/filetype/yamlfile.py +0 -0
  19. {halib-0.1.45 → halib-0.1.47}/halib/listop.py +0 -0
  20. {halib-0.1.45 → halib-0.1.47}/halib/online/__init__.py +0 -0
  21. {halib-0.1.45 → halib-0.1.47}/halib/online/gdrive.py +0 -0
  22. {halib-0.1.45 → halib-0.1.47}/halib/online/gdrive_mkdir.py +0 -0
  23. {halib-0.1.45 → halib-0.1.47}/halib/online/gdrive_test.py +0 -0
  24. {halib-0.1.45 → halib-0.1.47}/halib/online/projectmake.py +0 -0
  25. {halib-0.1.45 → halib-0.1.47}/halib/plot.py +0 -0
  26. {halib-0.1.45 → halib-0.1.47}/halib/rich_color.py +0 -0
  27. {halib-0.1.45 → halib-0.1.47}/halib/system/__init__.py +0 -0
  28. {halib-0.1.45 → halib-0.1.47}/halib/system/cmd.py +0 -0
  29. {halib-0.1.45 → halib-0.1.47}/halib/system/filesys.py +0 -0
  30. {halib-0.1.45 → halib-0.1.47}/halib/tele_noti.py +0 -0
  31. {halib-0.1.45 → halib-0.1.47}/halib/torchloader.py +0 -0
  32. {halib-0.1.45 → halib-0.1.47}/halib.egg-info/SOURCES.txt +0 -0
  33. {halib-0.1.45 → halib-0.1.47}/halib.egg-info/dependency_links.txt +0 -0
  34. {halib-0.1.45 → halib-0.1.47}/halib.egg-info/requires.txt +0 -0
  35. {halib-0.1.45 → halib-0.1.47}/halib.egg-info/top_level.txt +0 -0
  36. {halib-0.1.45 → halib-0.1.47}/setup.cfg +0 -0
  37. {halib-0.1.45 → halib-0.1.47}/test/test15.py +0 -0
  38. {halib-0.1.45 → halib-0.1.47}/test/test_df_creator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: halib
3
- Version: 0.1.45
3
+ Version: 0.1.47
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -15,7 +15,10 @@ License-File: LICENSE.txt
15
15
 
16
16
  Helper package for coding and automation
17
17
 
18
- **Version 0.1.45**
18
+ **Version 0.1.47**
19
+ + add `pprint_box` to print object/string in a box frame (like in `inspect`)
20
+
21
+ **Version 0.1.46**
19
22
  + filter the warning message of `UserWarning: Unable to import Axes3D.`
20
23
  + auto_wrap_text for `fn_display_df` to avoid long text in the table
21
24
 
@@ -1,6 +1,9 @@
1
1
  Helper package for coding and automation
2
2
 
3
- **Version 0.1.45**
3
+ **Version 0.1.47**
4
+ + add `pprint_box` to print object/string in a box frame (like in `inspect`)
5
+
6
+ **Version 0.1.46**
4
7
  + filter the warning message of `UserWarning: Unable to import Axes3D.`
5
8
  + auto_wrap_text for `fn_display_df` to avoid long text in the table
6
9
 
@@ -20,6 +20,7 @@ __all__ = [
20
20
  "pd",
21
21
  "plt",
22
22
  "pprint",
23
+ "pprint_box",
23
24
  "px",
24
25
  "rcolor_all_str",
25
26
  "rcolor_palette_all",
@@ -32,7 +33,7 @@ __all__ = [
32
33
  "timebudget",
33
34
  "tqdm",
34
35
  "warnings",
35
- "time"
36
+ "time",
36
37
  ]
37
38
  import warnings
38
39
  warnings.filterwarnings("ignore", message="Unable to import Axes3D")
@@ -53,7 +54,7 @@ from .system import cmd
53
54
  from .system import filesys as fs
54
55
  from .filetype import csvfile
55
56
  from .cuda import tcuda
56
- from .common import console, console_log, ConsoleLog, now_str, norm_str
57
+ from .common import console, console_log, ConsoleLog, now_str, norm_str, pprint_box
57
58
 
58
59
  # for log
59
60
  from loguru import logger
@@ -1,7 +1,9 @@
1
1
  import arrow
2
2
  import re
3
3
  from rich.console import Console
4
- from rich.pretty import pprint
4
+ from rich.pretty import pprint, Pretty
5
+ from rich.panel import Panel
6
+ import rich
5
7
 
6
8
  console = Console()
7
9
 
@@ -43,6 +45,16 @@ def norm_str(in_str):
43
45
  norm_string = norm_string.strip()
44
46
  return norm_string
45
47
 
48
+
49
+ def pprint_box(obj, title="", border_style="green"):
50
+ """
51
+ Pretty print an object in a box.
52
+ """
53
+ rich.print(
54
+ Panel(Pretty(obj, expand_all=True), title=title, border_style=border_style)
55
+ )
56
+
57
+
46
58
  def console_rule(msg, do_norm_msg=True, is_end_tag=False):
47
59
  msg = norm_str(msg) if do_norm_msg else msg
48
60
  if is_end_tag:
@@ -48,9 +48,9 @@ def auto_wrap(cell, width=40):
48
48
  return textwrap.fill(str(cell), width=width)
49
49
 
50
50
  def fn_display_df(df, max_col_width=40):
51
- # Apply wrapping
51
+ # Apply wrapping; tablefmt="psql" for PostgreSQL-like output
52
52
  wrapped_df = df.applymap(lambda x: auto_wrap(x, width=max_col_width))
53
- print(tabulate(wrapped_df, headers="keys", tablefmt="psql", numalign="right"))
53
+ print(tabulate(wrapped_df, headers="keys", tablefmt="grid", numalign="right"))
54
54
 
55
55
  def showdf(df, display_mode="itable", in_jupyter=True, all_interactive=False):
56
56
  if display_mode == "itable":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: halib
3
- Version: 0.1.45
3
+ Version: 0.1.47
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -15,7 +15,10 @@ License-File: LICENSE.txt
15
15
 
16
16
  Helper package for coding and automation
17
17
 
18
- **Version 0.1.45**
18
+ **Version 0.1.47**
19
+ + add `pprint_box` to print object/string in a box frame (like in `inspect`)
20
+
21
+ **Version 0.1.46**
19
22
  + filter the warning message of `UserWarning: Unable to import Axes3D.`
20
23
  + auto_wrap_text for `fn_display_df` to avoid long text in the table
21
24
 
@@ -8,7 +8,7 @@ with open("requirements.txt") as f:
8
8
 
9
9
  setuptools.setup(
10
10
  name="halib",
11
- version="0.1.45",
11
+ version="0.1.47",
12
12
  author="Hoang Van Ha",
13
13
  author_email="hoangvanhauit@gmail.com",
14
14
  description="Small library for common tasks",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes