rgwfuncs 0.0.90__py3-none-any.whl → 0.0.91__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.
- rgwfuncs/df_lib.py +109 -32
- rgwfuncs/interactive_shell_lib.py +19 -19
- rgwfuncs/str_lib.py +28 -11
- {rgwfuncs-0.0.90.dist-info → rgwfuncs-0.0.91.dist-info}/METADATA +23 -2
- rgwfuncs-0.0.91.dist-info/RECORD +12 -0
- {rgwfuncs-0.0.90.dist-info → rgwfuncs-0.0.91.dist-info}/WHEEL +1 -1
- rgwfuncs-0.0.90.dist-info/RECORD +0 -12
- {rgwfuncs-0.0.90.dist-info → rgwfuncs-0.0.91.dist-info}/entry_points.txt +0 -0
- {rgwfuncs-0.0.90.dist-info → rgwfuncs-0.0.91.dist-info/licenses}/LICENSE +0 -0
- {rgwfuncs-0.0.90.dist-info → rgwfuncs-0.0.91.dist-info}/top_level.txt +0 -0
rgwfuncs/df_lib.py
CHANGED
@@ -22,8 +22,7 @@ from email import encoders
|
|
22
22
|
from googleapiclient.discovery import build
|
23
23
|
import base64
|
24
24
|
import boto3
|
25
|
-
|
26
|
-
from typing import Optional, Dict, List, Tuple, Any, Callable
|
25
|
+
from typing import Optional, Dict, List, Tuple, Any, Callable, Union
|
27
26
|
import warnings
|
28
27
|
|
29
28
|
# Suppress all FutureWarnings
|
@@ -311,13 +310,17 @@ def drop_duplicates_retain_last(
|
|
311
310
|
return df.drop_duplicates(subset=columns_list, keep='last')
|
312
311
|
|
313
312
|
|
314
|
-
def load_data_from_query(db_preset_name: str, query: str) -> pd.DataFrame:
|
313
|
+
def load_data_from_query(db_preset_name: str, query: str, config: Optional[Union[str, dict]] = None) -> pd.DataFrame:
|
315
314
|
"""
|
316
315
|
Load data from a database query into a DataFrame based on a configuration preset.
|
317
316
|
|
318
317
|
Parameters:
|
319
318
|
db_preset_name: The name of the database preset in the configuration file.
|
320
319
|
query: The SQL query to execute.
|
320
|
+
config (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
321
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
322
|
+
- str: Path to a JSON configuration file
|
323
|
+
- dict: Direct configuration dictionary
|
321
324
|
|
322
325
|
Returns:
|
323
326
|
A DataFrame containing the query result.
|
@@ -327,6 +330,27 @@ def load_data_from_query(db_preset_name: str, query: str) -> pd.DataFrame:
|
|
327
330
|
ValueError: If the database preset or db_type is invalid.
|
328
331
|
"""
|
329
332
|
|
333
|
+
def get_config(config: Optional[Union[str, dict]] = None) -> dict:
|
334
|
+
"""Get telegram configuration either from a path or direct dictionary."""
|
335
|
+
def get_config_from_file(config_path: str) -> dict:
|
336
|
+
"""Load configuration from a JSON file."""
|
337
|
+
with open(config_path, 'r') as file:
|
338
|
+
return json.load(file)
|
339
|
+
|
340
|
+
# Determine the config to use
|
341
|
+
if config is None:
|
342
|
+
# Default to ~/.rgwfuncsrc if no config provided
|
343
|
+
config_path = os.path.expanduser('~/.rgwfuncsrc')
|
344
|
+
return get_config_from_file(config_path)
|
345
|
+
elif isinstance(config, str):
|
346
|
+
# If config is a string, treat it as a path and load it
|
347
|
+
return get_config_from_file(config)
|
348
|
+
elif isinstance(config, dict):
|
349
|
+
# If config is already a dict, use it directly
|
350
|
+
return config
|
351
|
+
else:
|
352
|
+
raise ValueError("Config must be either a path string or a dictionary")
|
353
|
+
|
330
354
|
def query_mssql(db_preset: Dict[str, Any], query: str) -> pd.DataFrame:
|
331
355
|
server = db_preset['host']
|
332
356
|
user = db_preset['username']
|
@@ -446,11 +470,7 @@ def load_data_from_query(db_preset_name: str, query: str) -> pd.DataFrame:
|
|
446
470
|
wait_for_athena_query_to_complete(athena_client, query_execution_id)
|
447
471
|
return download_athena_query_results(athena_client, query_execution_id)
|
448
472
|
|
449
|
-
|
450
|
-
config_path = os.path.expanduser('~/.rgwfuncsrc')
|
451
|
-
with open(config_path, 'r') as f:
|
452
|
-
config = json.load(f)
|
453
|
-
|
473
|
+
config = get_config(config)
|
454
474
|
db_presets = config.get('db_presets', [])
|
455
475
|
db_preset = next(
|
456
476
|
(preset for preset in db_presets if preset['name'] == db_preset_name),
|
@@ -846,7 +866,8 @@ def send_dataframe_via_telegram(
|
|
846
866
|
bot_name: str,
|
847
867
|
message: Optional[str] = None,
|
848
868
|
as_file: bool = True,
|
849
|
-
remove_after_send: bool = True
|
869
|
+
remove_after_send: bool = True,
|
870
|
+
config: Optional[Union[str, dict]] = None) -> None:
|
850
871
|
"""
|
851
872
|
Send a DataFrame via Telegram using a specified bot configuration.
|
852
873
|
|
@@ -856,6 +877,10 @@ def send_dataframe_via_telegram(
|
|
856
877
|
message: Custom message to send along with the DataFrame or file. Defaults to None.
|
857
878
|
as_file: Boolean flag to indicate whether the DataFrame should be sent as a file (True) or as text (False). Defaults to True.
|
858
879
|
remove_after_send: If True, removes the CSV file after sending. Defaults to True.
|
880
|
+
config (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
881
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
882
|
+
- str: Path to a JSON configuration file
|
883
|
+
- dict: Direct configuration dictionary
|
859
884
|
|
860
885
|
Raises:
|
861
886
|
ValueError: If the specified bot is not found or if no DataFrame is provided.
|
@@ -865,14 +890,29 @@ def send_dataframe_via_telegram(
|
|
865
890
|
The configuration file is assumed to be located at `~/.rgwfuncsrc`.
|
866
891
|
"""
|
867
892
|
|
868
|
-
def get_config(
|
869
|
-
"""
|
870
|
-
|
871
|
-
|
893
|
+
def get_config(config: Optional[Union[str, dict]] = None) -> dict:
|
894
|
+
"""Get telegram configuration either from a path or direct dictionary."""
|
895
|
+
def get_config_from_file(config_path: str) -> dict:
|
896
|
+
"""Load configuration from a JSON file."""
|
897
|
+
with open(config_path, 'r') as file:
|
898
|
+
return json.load(file)
|
899
|
+
|
900
|
+
# Determine the config to use
|
901
|
+
if config is None:
|
902
|
+
# Default to ~/.rgwfuncsrc if no config provided
|
903
|
+
config_path = os.path.expanduser('~/.rgwfuncsrc')
|
904
|
+
return get_config_from_file(config_path)
|
905
|
+
elif isinstance(config, str):
|
906
|
+
# If config is a string, treat it as a path and load it
|
907
|
+
return get_config_from_file(config)
|
908
|
+
elif isinstance(config, dict):
|
909
|
+
# If config is already a dict, use it directly
|
910
|
+
return config
|
911
|
+
else:
|
912
|
+
raise ValueError("Config must be either a path string or a dictionary")
|
872
913
|
|
873
|
-
|
874
|
-
|
875
|
-
config = get_config(config_path)
|
914
|
+
|
915
|
+
config = get_config(config)
|
876
916
|
|
877
917
|
bot_config = next(
|
878
918
|
(bot for bot in config['telegram_bot_presets'] if bot['name'] == bot_name),
|
@@ -926,7 +966,8 @@ def send_data_to_email(
|
|
926
966
|
subject: Optional[str] = None,
|
927
967
|
body: Optional[str] = None,
|
928
968
|
as_file: bool = True,
|
929
|
-
remove_after_send: bool = True
|
969
|
+
remove_after_send: bool = True,
|
970
|
+
config: Optional[Union[str, dict]] = None) -> None:
|
930
971
|
"""
|
931
972
|
Send an email with an optional DataFrame attachment using the Gmail API via a specified preset.
|
932
973
|
|
@@ -938,6 +979,10 @@ def send_data_to_email(
|
|
938
979
|
body: Optional message body of the email. Defaults to 'Please find the CSV file attached.' if not given.
|
939
980
|
as_file: Boolean flag to decide whether to send the DataFrame as a file (True) or embed it in the email (False). Defaults to True.
|
940
981
|
remove_after_send: If True, removes the CSV file after sending. Defaults to True.
|
982
|
+
config (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
983
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
984
|
+
- str: Path to a JSON configuration file
|
985
|
+
- dict: Direct configuration dictionary
|
941
986
|
|
942
987
|
Raises:
|
943
988
|
ValueError: If the preset is not found in the configuration.
|
@@ -947,12 +992,26 @@ def send_data_to_email(
|
|
947
992
|
The configuration file is assumed to be located at `~/.rgwfuncsrc`.
|
948
993
|
"""
|
949
994
|
|
950
|
-
def get_config(
|
951
|
-
|
952
|
-
|
995
|
+
def get_config(config: Optional[Union[str, dict]] = None) -> dict:
|
996
|
+
"""Get telegram configuration either from a path or direct dictionary."""
|
997
|
+
def get_config_from_file(config_path: str) -> dict:
|
998
|
+
"""Load configuration from a JSON file."""
|
999
|
+
with open(config_path, 'r') as file:
|
953
1000
|
return json.load(file)
|
954
|
-
|
955
|
-
|
1001
|
+
|
1002
|
+
# Determine the config to use
|
1003
|
+
if config is None:
|
1004
|
+
# Default to ~/.rgwfuncsrc if no config provided
|
1005
|
+
config_path = os.path.expanduser('~/.rgwfuncsrc')
|
1006
|
+
return get_config_from_file(config_path)
|
1007
|
+
elif isinstance(config, str):
|
1008
|
+
# If config is a string, treat it as a path and load it
|
1009
|
+
return get_config_from_file(config)
|
1010
|
+
elif isinstance(config, dict):
|
1011
|
+
# If config is already a dict, use it directly
|
1012
|
+
return config
|
1013
|
+
else:
|
1014
|
+
raise ValueError("Config must be either a path string or a dictionary")
|
956
1015
|
|
957
1016
|
def authenticate_service_account(
|
958
1017
|
service_account_credentials_path: str,
|
@@ -964,9 +1023,7 @@ def send_data_to_email(
|
|
964
1023
|
)
|
965
1024
|
return build('gmail', 'v1', credentials=credentials)
|
966
1025
|
|
967
|
-
|
968
|
-
config_path = os.path.expanduser('~/.rgwfuncsrc')
|
969
|
-
config = get_config(config_path)
|
1026
|
+
config = get_config(config)
|
970
1027
|
|
971
1028
|
# Retrieve Gmail preset configuration
|
972
1029
|
gmail_config = next(
|
@@ -1038,7 +1095,8 @@ def send_data_to_slack(
|
|
1038
1095
|
bot_name: str,
|
1039
1096
|
message: Optional[str] = None,
|
1040
1097
|
as_file: bool = True,
|
1041
|
-
remove_after_send: bool = True
|
1098
|
+
remove_after_send: bool = True,
|
1099
|
+
config: Optional[Union[str, dict]] = None) -> None:
|
1042
1100
|
"""
|
1043
1101
|
Send a DataFrame or message to Slack using a specified bot configuration.
|
1044
1102
|
|
@@ -1048,6 +1106,10 @@ def send_data_to_slack(
|
|
1048
1106
|
message: Custom message to send along with the DataFrame or file. Defaults to None.
|
1049
1107
|
as_file: Boolean flag to decide whether to send the DataFrame as a file (True) or as text (False). Defaults to True.
|
1050
1108
|
remove_after_send: If True, removes the CSV file after sending. Defaults to True.
|
1109
|
+
config (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
1110
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
1111
|
+
- str: Path to a JSON configuration file
|
1112
|
+
- dict: Direct configuration dictionary
|
1051
1113
|
|
1052
1114
|
Raises:
|
1053
1115
|
ValueError: If the specified bot is not found in the configuration.
|
@@ -1057,14 +1119,29 @@ def send_data_to_slack(
|
|
1057
1119
|
The configuration file is assumed to be located at `~/.rgwfuncsrc`.
|
1058
1120
|
"""
|
1059
1121
|
|
1060
|
-
def get_config(
|
1061
|
-
"""
|
1062
|
-
|
1063
|
-
|
1122
|
+
def get_config(config: Optional[Union[str, dict]] = None) -> dict:
|
1123
|
+
"""Get telegram configuration either from a path or direct dictionary."""
|
1124
|
+
def get_config_from_file(config_path: str) -> dict:
|
1125
|
+
"""Load configuration from a JSON file."""
|
1126
|
+
with open(config_path, 'r') as file:
|
1127
|
+
return json.load(file)
|
1128
|
+
|
1129
|
+
# Determine the config to use
|
1130
|
+
if config is None:
|
1131
|
+
# Default to ~/.rgwfuncsrc if no config provided
|
1132
|
+
config_path = os.path.expanduser('~/.rgwfuncsrc')
|
1133
|
+
return get_config_from_file(config_path)
|
1134
|
+
elif isinstance(config, str):
|
1135
|
+
# If config is a string, treat it as a path and load it
|
1136
|
+
return get_config_from_file(config)
|
1137
|
+
elif isinstance(config, dict):
|
1138
|
+
# If config is already a dict, use it directly
|
1139
|
+
return config
|
1140
|
+
else:
|
1141
|
+
raise ValueError("Config must be either a path string or a dictionary")
|
1064
1142
|
|
1065
1143
|
# Load the Slack configuration from ~/.rgwfuncsrc
|
1066
|
-
|
1067
|
-
config = get_config(config_path)
|
1144
|
+
config = get_config(config)
|
1068
1145
|
|
1069
1146
|
bot_config = next(
|
1070
1147
|
(bot for bot in config['slack_bot_presets'] if bot['name'] == bot_name),
|
@@ -11,20 +11,21 @@ from .algebra_lib import * # noqa: F401, F403, E402
|
|
11
11
|
from .str_lib import * # noqa: F401, F403, E402
|
12
12
|
from .docs_lib import * # noqa: F401, F403, E402
|
13
13
|
|
14
|
+
|
14
15
|
def interactive_shell(local_vars: Dict[str, Any]) -> None:
|
15
16
|
"""
|
16
17
|
Launch an interactive prompt for inspecting and modifying local variables,
|
17
18
|
with blue-colored output and a white prompt. An extra blank line appears before
|
18
19
|
each new prompt, and the welcome banner appears in blue. No extra exit message is printed.
|
19
|
-
|
20
|
+
|
20
21
|
local_vars: dictionary of variables available in the interactive shell.
|
21
22
|
"""
|
22
|
-
|
23
|
+
|
23
24
|
# ANSI color escape codes.
|
24
25
|
BLUE = "\033[94m"
|
25
26
|
WHITE = "\033[37m"
|
26
27
|
RESET = "\033[0m"
|
27
|
-
|
28
|
+
|
28
29
|
# Set up readline history.
|
29
30
|
def setup_readline() -> None:
|
30
31
|
HISTORY_FILE = os.path.expanduser("~/.rgwfuncs_shell_history")
|
@@ -36,13 +37,13 @@ def interactive_shell(local_vars: Dict[str, Any]) -> None:
|
|
36
37
|
except Exception as e:
|
37
38
|
print(f"Warning: Could not load history file: {e}")
|
38
39
|
atexit.register(readline.write_history_file, HISTORY_FILE)
|
39
|
-
|
40
|
+
|
40
41
|
# BlueStdout: a wrapper for sys.stdout to ensure output is in blue.
|
41
42
|
class BlueStdout:
|
42
43
|
def __init__(self, wrapped):
|
43
44
|
self.wrapped = wrapped
|
44
45
|
self.at_line_start = True
|
45
|
-
|
46
|
+
|
46
47
|
def write(self, s):
|
47
48
|
# If the output exactly matches our prompt, leave it uncolored.
|
48
49
|
if s == sys.ps1 or s == sys.ps2:
|
@@ -60,19 +61,19 @@ def interactive_shell(local_vars: Dict[str, Any]) -> None:
|
|
60
61
|
self.at_line_start = True
|
61
62
|
else:
|
62
63
|
self.at_line_start = (line == "")
|
63
|
-
|
64
|
+
|
64
65
|
def flush(self):
|
65
66
|
self.wrapped.flush()
|
66
|
-
|
67
|
+
|
67
68
|
def isatty(self):
|
68
69
|
return self.wrapped.isatty()
|
69
|
-
|
70
|
+
|
70
71
|
def fileno(self):
|
71
72
|
return self.wrapped.fileno()
|
72
|
-
|
73
|
+
|
73
74
|
def __getattr__(self, attr):
|
74
75
|
return getattr(self.wrapped, attr)
|
75
|
-
|
76
|
+
|
76
77
|
# ColorInteractiveConsole: a subclass that temporarily restores the original stdout
|
77
78
|
# while reading input and prints an extra blank line before each prompt.
|
78
79
|
class ColorInteractiveConsole(code.InteractiveConsole):
|
@@ -86,37 +87,36 @@ def interactive_shell(local_vars: Dict[str, Any]) -> None:
|
|
86
87
|
finally:
|
87
88
|
sys.stdout = saved_stdout
|
88
89
|
return line
|
89
|
-
|
90
|
+
|
90
91
|
# Ensure local_vars is a dictionary.
|
91
92
|
if not isinstance(local_vars, dict):
|
92
93
|
raise TypeError("local_vars must be a dictionary")
|
93
|
-
|
94
|
+
|
94
95
|
# Initialize readline history.
|
95
96
|
setup_readline()
|
96
|
-
|
97
|
+
|
97
98
|
# Merge globals into local_vars.
|
98
99
|
local_vars.update(globals())
|
99
|
-
|
100
|
+
|
100
101
|
# Wrap ANSI escape codes with markers (\001 and \002) so readline ignores these in prompt length.
|
101
102
|
sys.ps1 = "\001" + WHITE + "\002" + ">>> " + "\001" + RESET + "\002"
|
102
103
|
sys.ps2 = "\001" + WHITE + "\002" + "... " + "\001" + RESET + "\002"
|
103
|
-
|
104
|
+
|
104
105
|
# Replace sys.stdout with BlueStdout to ensure all output is printed in blue.
|
105
106
|
sys.stdout = BlueStdout(sys.__stdout__)
|
106
|
-
|
107
|
+
|
107
108
|
# Create our custom interactive console.
|
108
109
|
console = ColorInteractiveConsole(locals=local_vars)
|
109
|
-
|
110
|
+
|
110
111
|
# The welcome banner is explicitly wrapped in BLUE and RESET.
|
111
112
|
banner = (BLUE +
|
112
113
|
"Welcome to the rgwfuncs interactive shell.\n"
|
113
114
|
"Use up/down arrows for command history.\n"
|
114
115
|
"Type 'exit()' or Ctrl+D to quit." +
|
115
116
|
RESET)
|
116
|
-
|
117
|
+
|
117
118
|
# Call interact with an empty exit message.
|
118
119
|
try:
|
119
120
|
console.interact(banner=banner, exitmsg="")
|
120
121
|
except SystemExit:
|
121
122
|
pass
|
122
|
-
|
rgwfuncs/str_lib.py
CHANGED
@@ -1,32 +1,51 @@
|
|
1
1
|
import os
|
2
2
|
import json
|
3
3
|
import requests
|
4
|
-
from typing import Tuple
|
4
|
+
from typing import Tuple, Optional, Union, Dict
|
5
5
|
import warnings
|
6
6
|
|
7
7
|
# Suppress all FutureWarnings
|
8
8
|
warnings.filterwarnings("ignore", category=FutureWarning)
|
9
9
|
|
10
10
|
|
11
|
-
def send_telegram_message(preset_name: str, message: str) -> None:
|
11
|
+
def send_telegram_message(preset_name: str, message: str, config: Optional[Union[str, dict]] = None) -> None:
|
12
12
|
"""
|
13
13
|
Send a Telegram message using the specified preset.
|
14
14
|
|
15
15
|
Args:
|
16
16
|
preset_name (str): The name of the preset to use for sending the message.
|
17
17
|
message (str): The message to send.
|
18
|
+
config (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
19
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
20
|
+
- str: Path to a JSON configuration file
|
21
|
+
- dict: Direct configuration dictionary
|
18
22
|
|
19
23
|
Raises:
|
20
24
|
RuntimeError: If the preset is not found or necessary details are missing.
|
21
25
|
"""
|
22
26
|
|
23
|
-
|
24
|
-
|
27
|
+
def get_config(config: Optional[Union[str, dict]] = None) -> dict:
|
28
|
+
"""Get telegram configuration either from a path or direct dictionary."""
|
29
|
+
def get_config_from_file(config_path: str) -> dict:
|
30
|
+
"""Load configuration from a JSON file."""
|
31
|
+
with open(config_path, 'r') as file:
|
32
|
+
return json.load(file)
|
33
|
+
|
34
|
+
# Determine the config to use
|
35
|
+
if config is None:
|
36
|
+
# Default to ~/.rgwfuncsrc if no config provided
|
37
|
+
config_path = os.path.expanduser('~/.rgwfuncsrc')
|
38
|
+
return get_config_from_file(config_path)
|
39
|
+
elif isinstance(config, str):
|
40
|
+
# If config is a string, treat it as a path and load it
|
41
|
+
return get_config_from_file(config)
|
42
|
+
elif isinstance(config, dict):
|
43
|
+
# If config is already a dict, use it directly
|
44
|
+
return config
|
45
|
+
else:
|
46
|
+
raise ValueError("Config must be either a path string or a dictionary")
|
47
|
+
|
25
48
|
|
26
|
-
def load_config() -> dict:
|
27
|
-
"""Load the configuration from the .rgwfuncsrc file."""
|
28
|
-
with open(config_path, 'r') as file:
|
29
|
-
return json.load(file)
|
30
49
|
|
31
50
|
def get_telegram_preset(config: dict, preset_name: str) -> dict:
|
32
51
|
"""Get the Telegram preset configuration."""
|
@@ -53,9 +72,7 @@ def send_telegram_message(preset_name: str, message: str) -> None:
|
|
53
72
|
|
54
73
|
return bot_token, chat_id
|
55
74
|
|
56
|
-
|
57
|
-
config = load_config()
|
58
|
-
|
75
|
+
config = get_config(config)
|
59
76
|
# Get bot details from the configuration
|
60
77
|
bot_token, chat_id = get_telegram_bot_details(config, preset_name)
|
61
78
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: rgwfuncs
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.91
|
4
4
|
Summary: A functional programming paradigm for mathematical modelling and data science
|
5
5
|
Home-page: https://github.com/ryangerardwilson/rgwfunc
|
6
6
|
Author: Ryan Gerard Wilson
|
@@ -24,6 +24,7 @@ Requires-Dist: requests
|
|
24
24
|
Requires-Dist: slack-sdk
|
25
25
|
Requires-Dist: google-api-python-client
|
26
26
|
Requires-Dist: boto3
|
27
|
+
Dynamic: license-file
|
27
28
|
|
28
29
|
# RGWFUNCS
|
29
30
|
|
@@ -602,6 +603,10 @@ Send a message to a Telegram chat using a specified preset from your configurati
|
|
602
603
|
• Parameters:
|
603
604
|
- `preset_name` (str): The name of the preset to use for sending the message. This should match a preset in the configuration file.
|
604
605
|
- `message` (str): The message text that you want to send to the Telegram chat.
|
606
|
+
- config (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
607
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
608
|
+
- str: Path to a JSON configuration file
|
609
|
+
- dict: Direct configuration dictionary
|
605
610
|
|
606
611
|
• Raises:
|
607
612
|
- `RuntimeError`: If the preset is not found in the configuration file or if necessary details (bot token or chat ID) are missing.
|
@@ -864,6 +869,10 @@ Load data from a specified database using a SQL query and return the results in
|
|
864
869
|
|
865
870
|
- `db_preset_name` (str): The name of the database preset found in the configuration file. This preset determines which database connection details to use.
|
866
871
|
- `query` (str): The SQL query string to be executed on the database.
|
872
|
+
- `config` (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
873
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
874
|
+
- str: Path to a JSON configuration file
|
875
|
+
- dict: Direct configuration dictionary
|
867
876
|
|
868
877
|
#### Returns
|
869
878
|
|
@@ -1127,6 +1136,10 @@ Send a DataFrame via Telegram using a specified bot configuration.
|
|
1127
1136
|
- message (str)
|
1128
1137
|
- `as_file` (bool)
|
1129
1138
|
- `remove_after_send` (bool)
|
1139
|
+
- `config` (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
1140
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
1141
|
+
- str: Path to a JSON configuration file
|
1142
|
+
- dict: Direct configuration dictionary
|
1130
1143
|
|
1131
1144
|
• Example:
|
1132
1145
|
|
@@ -1156,6 +1169,10 @@ Send an email with an optional DataFrame attachment using the Gmail API via a sp
|
|
1156
1169
|
- body (str, optional)
|
1157
1170
|
- `as_file` (bool)
|
1158
1171
|
- `remove_after_send` (bool)
|
1172
|
+
- `config` (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
1173
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
1174
|
+
- str: Path to a JSON configuration file
|
1175
|
+
- dict: Direct configuration dictionary
|
1159
1176
|
|
1160
1177
|
• Example:
|
1161
1178
|
|
@@ -1184,6 +1201,10 @@ Send a DataFrame or message to Slack using a specified bot configuration.
|
|
1184
1201
|
- message (str)
|
1185
1202
|
- `as_file` (bool)
|
1186
1203
|
- `remove_after_send` (bool)
|
1204
|
+
- `config` (Optional[Union[str, dict]], optional): Configuration source. Can be:
|
1205
|
+
- None: Uses default path '~/.rgwfuncsrc'
|
1206
|
+
- str: Path to a JSON configuration file
|
1207
|
+
- dict: Direct configuration dictionary
|
1187
1208
|
|
1188
1209
|
• Example:
|
1189
1210
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
rgwfuncs/__init__.py,sha256=LSn54Tlyskcb6Wab_wUpPLB6UGMe5LdrB3GU88mDEbU,1712
|
2
|
+
rgwfuncs/algebra_lib.py,sha256=rKFITfpWfgdBswnbMUuS41XgndEt-jUVz2ObO_ik7eM,42234
|
3
|
+
rgwfuncs/df_lib.py,sha256=coAmZ2RyWvovorNekQnLW5cUIZyY-h6s88YUm0ytFAw,75107
|
4
|
+
rgwfuncs/docs_lib.py,sha256=i63NzX-V8cGhikYdtkRGAEe2VcuwpXxDUyTRa9xI7l8,1972
|
5
|
+
rgwfuncs/interactive_shell_lib.py,sha256=YN0ZnM5twIsOeDKuOQ9ZGURCvvBX0RZjM4a1vO1C3E8,4281
|
6
|
+
rgwfuncs/str_lib.py,sha256=-dcJt-jE0YG-XwHcNslCM_Gp-L0Ho0zYFPxjrxepzzA,3210
|
7
|
+
rgwfuncs-0.0.91.dist-info/licenses/LICENSE,sha256=jLvt20gcUZYB8UOvyBvyKQ1qhYYhD__qP7ZDx2lPFkU,1062
|
8
|
+
rgwfuncs-0.0.91.dist-info/METADATA,sha256=BVQ4dPy_oI5jTtqwEBfj96OGqwIlOy8Ib57Je7Q6Tuk,61390
|
9
|
+
rgwfuncs-0.0.91.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
|
10
|
+
rgwfuncs-0.0.91.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
|
11
|
+
rgwfuncs-0.0.91.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
|
12
|
+
rgwfuncs-0.0.91.dist-info/RECORD,,
|
rgwfuncs-0.0.90.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
rgwfuncs/__init__.py,sha256=LSn54Tlyskcb6Wab_wUpPLB6UGMe5LdrB3GU88mDEbU,1712
|
2
|
-
rgwfuncs/algebra_lib.py,sha256=rKFITfpWfgdBswnbMUuS41XgndEt-jUVz2ObO_ik7eM,42234
|
3
|
-
rgwfuncs/df_lib.py,sha256=r6T-MwyDq9NAPW1Xf6NzSy7ZFicIKdemR-UKu6TZt5g,71111
|
4
|
-
rgwfuncs/docs_lib.py,sha256=i63NzX-V8cGhikYdtkRGAEe2VcuwpXxDUyTRa9xI7l8,1972
|
5
|
-
rgwfuncs/interactive_shell_lib.py,sha256=F9Kul06SK-X1DxFpINDLEHFab7UaqFHgx2eYmdmMoOg,4393
|
6
|
-
rgwfuncs/str_lib.py,sha256=rtAdRlnSJIu3JhI-tA_A0wCiPK2m-zn5RoGpBxv_g-4,2228
|
7
|
-
rgwfuncs-0.0.90.dist-info/LICENSE,sha256=jLvt20gcUZYB8UOvyBvyKQ1qhYYhD__qP7ZDx2lPFkU,1062
|
8
|
-
rgwfuncs-0.0.90.dist-info/METADATA,sha256=VqTLa3ss_JZSpa0DWB8pOgCitIKCuSL7xIl02JjDShk,60288
|
9
|
-
rgwfuncs-0.0.90.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
-
rgwfuncs-0.0.90.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
|
11
|
-
rgwfuncs-0.0.90.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
|
12
|
-
rgwfuncs-0.0.90.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|