rgwfuncs 0.0.67__tar.gz → 0.0.68__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {rgwfuncs-0.0.67/src/rgwfuncs.egg-info → rgwfuncs-0.0.68}/PKG-INFO +1 -1
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/pyproject.toml +1 -1
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/setup.cfg +1 -1
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs/__init__.py +1 -1
- rgwfuncs-0.0.68/src/rgwfuncs/interactive_shell_lib.py +50 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68/src/rgwfuncs.egg-info}/PKG-INFO +1 -1
- rgwfuncs-0.0.67/src/rgwfuncs/interactive_shell_lib.py +0 -32
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/LICENSE +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/README.md +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs/algebra_lib.py +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs/df_lib.py +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs/docs_lib.py +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs/str_lib.py +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs.egg-info/SOURCES.txt +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs.egg-info/dependency_links.txt +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs.egg-info/entry_points.txt +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs.egg-info/requires.txt +0 -0
- {rgwfuncs-0.0.67 → rgwfuncs-0.0.68}/src/rgwfuncs.egg-info/top_level.txt +0 -0
@@ -2,7 +2,7 @@
|
|
2
2
|
# Dynamically importing functions from modules
|
3
3
|
|
4
4
|
from .df_lib import append_columns, append_percentile_classification_column, append_ranged_classification_column, append_ranged_date_classification_column, append_rows, append_xgb_labels, append_xgb_logistic_regression_predictions, append_xgb_regression_predictions, bag_union_join, bottom_n_unique_values, cascade_sort, delete_rows, drop_duplicates, drop_duplicates_retain_first, drop_duplicates_retain_last, filter_dataframe, filter_indian_mobiles, first_n_rows, from_raw_data, insert_dataframe_in_sqlite_database, last_n_rows, left_join, limit_dataframe, load_data_from_path, load_data_from_query, load_data_from_sqlite_path, load_fresh_data_or_pull_from_cache, mask_against_dataframe, mask_against_dataframe_converse, numeric_clean, order_columns, print_correlation, print_dataframe, print_memory_usage, print_n_frequency_cascading, print_n_frequency_linear, rename_columns, retain_columns, right_join, send_data_to_email, send_data_to_slack, send_dataframe_via_telegram, sync_dataframe_to_sqlite_database, top_n_unique_values, union_join, update_rows
|
5
|
-
from .interactive_shell_lib import interactive_shell
|
5
|
+
from .interactive_shell_lib import interactive_shell, setup_readline
|
6
6
|
from .algebra_lib import cancel_polynomial_expression, compute_constant_expression, compute_constant_expression_involving_matrices, compute_constant_expression_involving_ordered_series, compute_prime_factors, expand_polynomial_expression, factor_polynomial_expression, plot_polynomial_functions, plot_x_points_of_polynomial_functions, python_polynomial_expression_to_latex, simplify_polynomial_expression, solve_homogeneous_polynomial_expression
|
7
7
|
from .docs_lib import docs
|
8
8
|
from .str_lib import send_telegram_message
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
import code
|
3
|
+
import readline
|
4
|
+
import rlcompleter # noqa: F401
|
5
|
+
import sys # noqa: F401
|
6
|
+
import os
|
7
|
+
import atexit
|
8
|
+
from typing import Dict, Any
|
9
|
+
from .df_lib import * # noqa: F401, F403, E402
|
10
|
+
from .algebra_lib import * # noqa: F401, F403, E402
|
11
|
+
from .str_lib import * # noqa: F401, F403, E402
|
12
|
+
from .docs_lib import * # noqa: F401, F403, E402
|
13
|
+
|
14
|
+
# File for command history
|
15
|
+
HISTORY_FILE = os.path.expanduser("~/.rgwfuncs_shell_history")
|
16
|
+
|
17
|
+
def setup_readline():
|
18
|
+
"""Set up readline for command history persistence"""
|
19
|
+
readline.set_history_length(1000) # Limit history to 1000 lines
|
20
|
+
readline.parse_and_bind("tab: complete") # Enable tab completion
|
21
|
+
if os.path.exists(HISTORY_FILE):
|
22
|
+
try:
|
23
|
+
readline.read_history_file(HISTORY_FILE)
|
24
|
+
except Exception as e:
|
25
|
+
print(f"Warning: Could not load history file: {e}")
|
26
|
+
atexit.register(readline.write_history_file, HISTORY_FILE)
|
27
|
+
|
28
|
+
def interactive_shell(local_vars: Dict[str, Any]) -> None:
|
29
|
+
"""
|
30
|
+
Launches an interactive prompt for inspecting and modifying local variables, making all methods
|
31
|
+
in the rgwfuncs library available by default. Persists command history across sessions.
|
32
|
+
|
33
|
+
Parameters:
|
34
|
+
local_vars (dict): Dictionary of local variables to be available in the interactive shell.
|
35
|
+
"""
|
36
|
+
if not isinstance(local_vars, dict):
|
37
|
+
raise TypeError("local_vars must be a dictionary")
|
38
|
+
|
39
|
+
# Set up readline for history and completion
|
40
|
+
setup_readline()
|
41
|
+
|
42
|
+
# Make imported functions available in the REPL
|
43
|
+
local_vars.update(globals())
|
44
|
+
|
45
|
+
# Create interactive console with local context
|
46
|
+
console = code.InteractiveConsole(locals=local_vars)
|
47
|
+
|
48
|
+
# Start interactive session with a custom banner
|
49
|
+
banner = "Welcome to the rgwfuncs interactive shell.\nUse up/down arrows for command history.\nType 'exit()' or Ctrl+D to quit."
|
50
|
+
console.interact(banner=banner, exitmsg="Goodbye.")
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import code
|
2
|
-
import readline
|
3
|
-
import rlcompleter # noqa: F401
|
4
|
-
import sys # noqa: F401
|
5
|
-
from typing import Dict, Any
|
6
|
-
from .df_lib import * # noqa: F401, F403, E402
|
7
|
-
from .algebra_lib import * # noqa: F401, F403, E402
|
8
|
-
from .str_lib import * # noqa: F401, F403, E402
|
9
|
-
from .docs_lib import * # noqa: F401, F403, E402
|
10
|
-
|
11
|
-
|
12
|
-
def interactive_shell(local_vars: Dict[str, Any]) -> None:
|
13
|
-
"""
|
14
|
-
Launches an interactive prompt for inspecting and modifying local variables, making all methods
|
15
|
-
in the rgwfuncs library available by default.
|
16
|
-
|
17
|
-
Parameters:
|
18
|
-
local_vars (dict): Dictionary of local variables to be available in the interactive shell.
|
19
|
-
"""
|
20
|
-
if not isinstance(local_vars, dict):
|
21
|
-
raise TypeError("local_vars must be a dictionary")
|
22
|
-
|
23
|
-
readline.parse_and_bind("tab: complete")
|
24
|
-
|
25
|
-
# Make imported functions available in the REPL
|
26
|
-
local_vars.update(globals())
|
27
|
-
|
28
|
-
# Create interactive console with local context
|
29
|
-
console = code.InteractiveConsole(locals=local_vars)
|
30
|
-
|
31
|
-
# Start interactive session
|
32
|
-
console.interact(banner="Welcome to the rgwfuncs interactive shell.")
|
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
|