corelp 1.0.35__tar.gz → 1.0.36__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 (49) hide show
  1. {corelp-1.0.35 → corelp-1.0.36}/PKG-INFO +6 -3
  2. {corelp-1.0.35 → corelp-1.0.36}/pyproject.toml +6 -2
  3. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/Section_LP/Section.py +3 -3
  4. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/main_LP/main.py +3 -5
  5. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/print_LP/print.py +11 -6
  6. {corelp-1.0.35 → corelp-1.0.36}/README.md +0 -0
  7. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/__init__.py +0 -0
  8. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/icon_pythonLP.png +0 -0
  9. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/Path_LP/Path.py +0 -0
  10. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/Path_LP/__init__.py +0 -0
  11. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/Path_LP/test_Path.py +0 -0
  12. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/Section_LP/__init__.py +0 -0
  13. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/Section_LP/test_Section.py +0 -0
  14. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/__init__.py +0 -0
  15. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/debug_LP/__init__.py +0 -0
  16. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/debug_LP/debug.py +0 -0
  17. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/debug_LP/test_debug.py +0 -0
  18. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/folder_LP/__init__.py +0 -0
  19. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/folder_LP/folder.py +0 -0
  20. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/folder_LP/test_folder.py +0 -0
  21. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/getmodule_LP/__init__.py +0 -0
  22. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/getmodule_LP/getmodule.py +0 -0
  23. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/kwargsself_LP/__init__.py +0 -0
  24. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/kwargsself_LP/kwargsself.py +0 -0
  25. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/kwargsself_LP/test_kwargsself.py +0 -0
  26. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/main_LP/__init__.py +0 -0
  27. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/main_LP/test_main.py +0 -0
  28. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/print_LP/__init__.py +0 -0
  29. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/print_LP/test_print.py +0 -0
  30. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/prop_LP/__init__.py +0 -0
  31. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/prop_LP/prop.py +0 -0
  32. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/prop_LP/test_prop.py +0 -0
  33. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/rfrom_LP/__init__.py +0 -0
  34. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/rfrom_LP/rfrom.py +0 -0
  35. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/rfrom_LP/test_rfrom.py +0 -0
  36. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/selfkwargs_LP/__init__.py +0 -0
  37. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/selfkwargs_LP/selfkwargs.py +0 -0
  38. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/selfkwargs_LP/test_selfkwargs.py +0 -0
  39. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/test_LP/__init__.py +0 -0
  40. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/test_LP/test.py +0 -0
  41. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/test_LP/test_test.py +0 -0
  42. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/user_inputs_LP/__init__.py +0 -0
  43. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/user_inputs_LP/test_user_inputs.py +0 -0
  44. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules/user_inputs_LP/user_inputs.py +0 -0
  45. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/modules.json +0 -0
  46. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/py.typed +0 -0
  47. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/pythonLP.png:Zone.Identifier +0 -0
  48. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/scripts/__init__.py +0 -0
  49. {corelp-1.0.35 → corelp-1.0.36}/src/corelp/scripts.json +0 -0
@@ -1,10 +1,13 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: corelp
3
- Version: 1.0.35
3
+ Version: 1.0.36
4
4
  Summary: A library that gathers core functions for python programming.
5
- Requires-Dist: joblib
6
- Requires-Dist: rich
5
+ Requires-Dist: joblib ; extra == 'script'
6
+ Requires-Dist: rich ; extra == 'script'
7
+ Requires-Dist: marimo ; extra == 'script'
7
8
  Requires-Python: >=3.12
9
+ Provides-Extra: lib
10
+ Provides-Extra: script
8
11
  Description-Content-Type: text/markdown
9
12
 
10
13
  # coreLP
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "corelp"
3
- version = "1.0.35"
3
+ version = "1.0.36"
4
4
  description = "A library that gathers core functions for python programming."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
- dependencies = [ "joblib", "rich",]
7
+ dependencies = []
8
8
 
9
9
  [build-system]
10
10
  requires = [ "uv_build>=0.8.8,<0.9.0",]
@@ -15,5 +15,9 @@ dev = [ "pytest",]
15
15
  docs = [ "sphinx", "sphinx-design", "sphinx-rtd-theme", "toml",]
16
16
  anaconda = [ "ipykernel", "spyder-kernels",]
17
17
 
18
+ [project.optional-dependencies]
19
+ lib = []
20
+ script = [ "joblib", "rich", "marimo",]
21
+
18
22
  [tool.uv]
19
23
  required-environments = [ "sys_platform == 'linux' and platform_machine == 'x86_64'", "sys_platform == 'win32' and (platform_machine == 'AMD64' or platform_machine == 'x86_64')",]
@@ -99,17 +99,17 @@ class Section() :
99
99
  @wraps(func)
100
100
  def wrapper(*args, **kwargs):
101
101
  wrapper.path = self.path / f"{num:03}_{name}"
102
- print(f'\n#### {num}. {name.replace("_"," ")} section\n')
102
+ print(f'\n#### **{num}. {name.replace("_"," ")} section**\n')
103
103
 
104
104
  # Creating hash
105
105
  if cache :
106
- print('**Call hash:**')
106
+ print('**Call hash:**', do_stdout=False)
107
107
  bound = inspect.signature(func).bind(*args, **kwargs)
108
108
  bound.apply_defaults()
109
109
  serialized = pickle.dumps(bound.arguments)
110
110
  args_hash = hashlib.md5(serialized).hexdigest()
111
111
  result_file = wrapper.path / f'{args_hash}.pkl'
112
- print(f'*{args_hash}*\n')
112
+ print(f'*{args_hash}*\n', do_stdout=False)
113
113
 
114
114
  # Checking already calculated exists
115
115
  if result_file.exists() and not new :
@@ -51,8 +51,6 @@ def main() :
51
51
  The import_subfolders and export_subfolder are defined from import_path and export_path respectively (they are not absolute from root path).
52
52
  overnight : bool
53
53
  If True and exception occurs, will skip and pass to the next run in bulk processing. To use for example for overnight bulk processing.
54
- run_name : str or None
55
- Prefix to use for the output folder, if None takes the name of function decorated.
56
54
 
57
55
  Examples
58
56
  --------
@@ -180,7 +178,7 @@ def main() :
180
178
  print_status = kwargsself(print)
181
179
  print.console = None
182
180
  print.file = md_file
183
- print(f'\n\n\n# BEGIN {name}\n')
181
+ print(f'\n\n\n# **BEGIN {name}\n**')
184
182
  print(f"{time.ctime()}")
185
183
  if ipath != "None" :
186
184
  print(f'import_path : {ipath}\n')
@@ -209,7 +207,7 @@ def main() :
209
207
  #Applying function
210
208
  print("\n---\n")
211
209
  subfolder_string = f"{export_subfolder}" if export_subfolder != "" else ""
212
- print(f'## Launched script {subfolder_string}\n')
210
+ print(f'## **Launched script {subfolder_string}**\n')
213
211
  tic = time.perf_counter()
214
212
  try :
215
213
  results[export_subfolder] = new_func()
@@ -231,7 +229,7 @@ def main() :
231
229
 
232
230
  # END
233
231
  print(time.ctime())
234
- print(f'# END {name}\n\n')
232
+ print(f'# **END {name}**\n\n')
235
233
  print.export_html(html_file)
236
234
  selfkwargs(print, print_status)
237
235
  if _bulk is None :
@@ -20,6 +20,7 @@ This function overrides python built in print function to add functionnalities.
20
20
  from corelp import prop
21
21
  from dataclasses import dataclass, field
22
22
  from datetime import datetime, timedelta
23
+ from numpy._core.numeric import True_
23
24
  from rich import print as richprint
24
25
  from rich.console import Console
25
26
  from rich.theme import Theme
@@ -135,7 +136,7 @@ class Print() :
135
136
  """
136
137
 
137
138
  # Main function
138
- def __call__(self, *strings, verbose=None, return_string=False, file=None, mode='a', end='\n', **kwargs) :
139
+ def __call__(self, *strings, verbose=None, do_stdout=True, do_file=True, return_string=False, file=None, mode='a', end='\n', **kwargs) :
139
140
 
140
141
  # Muting
141
142
  verbose = verbose if verbose is not None else self.verbose
@@ -146,13 +147,16 @@ class Print() :
146
147
  string = ", ".join([str(string) for string in strings]) + end
147
148
 
148
149
  # Printing markdown
149
- self.print(Markdown(string), **kwargs)
150
+ if do_stdout :
151
+ string2print = Markdown(string) if self.apply_markdown else string
152
+ self.print(string2print, **kwargs)
150
153
 
151
154
  # Writting to file
152
- file = file if file is not None else self.file
153
- if file is not None :
154
- with open(Path(file), mode) as file :
155
- file.write(string)
155
+ if do_file :
156
+ file = file if file is not None else self.file
157
+ if file is not None :
158
+ with open(Path(file), mode) as file :
159
+ file.write(string)
156
160
 
157
161
  # Return
158
162
  if return_string :
@@ -174,6 +178,7 @@ class Print() :
174
178
  return self.console.log
175
179
  pyprint = pyprint # python print
176
180
  richprint = richprint # rich prints
181
+ apply_markdown : bool = field(default=True, repr=False) # True to apply rich markdown formatting in prints
177
182
 
178
183
 
179
184
 
File without changes
File without changes
File without changes
File without changes
File without changes