rgwfuncs 0.0.6__tar.gz → 0.0.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.6
3
+ Version: 0.0.8
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
@@ -28,19 +28,93 @@ Requires-Dist: google-api-python-client
28
28
 
29
29
  ***By Ryan Gerard Wilson (https://ryangerardwilson.com)***
30
30
 
31
- This library provides a variety of functions for manipulating and analyzing pandas DataFrames.
31
+ This library is meant to make ML/ Data Science pipelines more readable. It assumes a linux environment, and the existence of a `rgwml.config` file for certain features (like db querying, sending data to slack, etc.)
32
32
 
33
33
  --------------------------------------------------------------------------------
34
34
 
35
35
  ## Installation
36
36
 
37
37
  Install the package using:
38
- bash
39
- pip install rgwfuncs
40
38
 
39
+ pip install rgwfuncs
41
40
 
42
41
  --------------------------------------------------------------------------------
43
42
 
43
+ ## Create a `rgwml.config` File
44
+
45
+ A `rgwml.config` file (located at `vi ~/Documents/rgwml.config) is required for MSSQL, CLICKHOUSE, MYSQL, GOOGLE BIG QUERY, SLACK, TELEGRAM, and GMAIL integrations.
46
+
47
+ {
48
+ "db_presets" : [
49
+ {
50
+ "name": "mssql_db9",
51
+ "db_type": "mssql",
52
+ "host": "",
53
+ "username": "",
54
+ "password": "",
55
+ "database": ""
56
+ },
57
+ {
58
+ "name": "clickhouse_db7",
59
+ "db_type": "clickhouse",
60
+ "host": "",
61
+ "username": "",
62
+ "password": "",
63
+ "database": ""
64
+ },
65
+ {
66
+ "name": "mysql_db2",
67
+ "db_type": "mysql",
68
+ "host": "",
69
+ "username": "",
70
+ "password": "",
71
+ "database": ""
72
+ },
73
+ {
74
+ "name": "bq_db1",
75
+ "db_type": "google_big_query",
76
+ "json_file_path": "",
77
+ "project_id": ""
78
+ }
79
+ ],
80
+ "vm_presets": [
81
+ {
82
+ "name": "main_server",
83
+ "host": "",
84
+ "ssh_user": "",
85
+ "ssh_key_path": ""
86
+ }
87
+ ],
88
+ "cloud_storage_presets": [
89
+ {
90
+ "name": "gcs_bucket_name",
91
+ "credential_path": "/path/to/your/credentials.json"
92
+ }
93
+ ],
94
+ "telegram_bot_presets": [
95
+ {
96
+ "name": "rgwml-bot",
97
+ "chat_id": "",
98
+ "bot_token": ""
99
+ }
100
+ ],
101
+ "slack_bot_presets": [
102
+ {
103
+ "name": "labs-channel",
104
+ "channel_id": "",
105
+ "bot_token": ""
106
+ }
107
+ ],
108
+ "gmail_bot_presets": [
109
+ {
110
+ "name": "info@xyz.com",
111
+ "service_account_credentials_path": "/path/to/your/credentials.json"
112
+ }
113
+ ]
114
+ }
115
+
116
+ --------------------------------------------------------------------------------
117
+
44
118
  ## Basic Usage
45
119
 
46
120
  Import the library:
@@ -2,19 +2,93 @@
2
2
 
3
3
  ***By Ryan Gerard Wilson (https://ryangerardwilson.com)***
4
4
 
5
- This library provides a variety of functions for manipulating and analyzing pandas DataFrames.
5
+ This library is meant to make ML/ Data Science pipelines more readable. It assumes a linux environment, and the existence of a `rgwml.config` file for certain features (like db querying, sending data to slack, etc.)
6
6
 
7
7
  --------------------------------------------------------------------------------
8
8
 
9
9
  ## Installation
10
10
 
11
11
  Install the package using:
12
- bash
13
- pip install rgwfuncs
14
12
 
13
+ pip install rgwfuncs
15
14
 
16
15
  --------------------------------------------------------------------------------
17
16
 
17
+ ## Create a `rgwml.config` File
18
+
19
+ A `rgwml.config` file (located at `vi ~/Documents/rgwml.config) is required for MSSQL, CLICKHOUSE, MYSQL, GOOGLE BIG QUERY, SLACK, TELEGRAM, and GMAIL integrations.
20
+
21
+ {
22
+ "db_presets" : [
23
+ {
24
+ "name": "mssql_db9",
25
+ "db_type": "mssql",
26
+ "host": "",
27
+ "username": "",
28
+ "password": "",
29
+ "database": ""
30
+ },
31
+ {
32
+ "name": "clickhouse_db7",
33
+ "db_type": "clickhouse",
34
+ "host": "",
35
+ "username": "",
36
+ "password": "",
37
+ "database": ""
38
+ },
39
+ {
40
+ "name": "mysql_db2",
41
+ "db_type": "mysql",
42
+ "host": "",
43
+ "username": "",
44
+ "password": "",
45
+ "database": ""
46
+ },
47
+ {
48
+ "name": "bq_db1",
49
+ "db_type": "google_big_query",
50
+ "json_file_path": "",
51
+ "project_id": ""
52
+ }
53
+ ],
54
+ "vm_presets": [
55
+ {
56
+ "name": "main_server",
57
+ "host": "",
58
+ "ssh_user": "",
59
+ "ssh_key_path": ""
60
+ }
61
+ ],
62
+ "cloud_storage_presets": [
63
+ {
64
+ "name": "gcs_bucket_name",
65
+ "credential_path": "/path/to/your/credentials.json"
66
+ }
67
+ ],
68
+ "telegram_bot_presets": [
69
+ {
70
+ "name": "rgwml-bot",
71
+ "chat_id": "",
72
+ "bot_token": ""
73
+ }
74
+ ],
75
+ "slack_bot_presets": [
76
+ {
77
+ "name": "labs-channel",
78
+ "channel_id": "",
79
+ "bot_token": ""
80
+ }
81
+ ],
82
+ "gmail_bot_presets": [
83
+ {
84
+ "name": "info@xyz.com",
85
+ "service_account_credentials_path": "/path/to/your/credentials.json"
86
+ }
87
+ ]
88
+ }
89
+
90
+ --------------------------------------------------------------------------------
91
+
18
92
  ## Basic Usage
19
93
 
20
94
  Import the library:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rgwfuncs"
7
- version = "0.0.6"
7
+ version = "0.0.8"
8
8
  authors = [
9
9
  { name = "Ryan Gerard Wilson", email = "ryangerardwilson@gmail.com" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = rgwfuncs
3
- version = 0.0.6
3
+ version = 0.0.8
4
4
  author = Ryan Gerard Wilson
5
5
  author_email = ryangerardwilson@gmail.com
6
6
  description = A functional programming paradigm for mathematical modelling and data science
@@ -27,10 +27,13 @@ from typing import Optional, Callable, Dict, List, Tuple, Any
27
27
 
28
28
  def docs(method_type_filter: Optional[str] = None) -> None:
29
29
  """
30
- Print a list of function names in alphabetical order. If method_type_filter is specified, print the docstrings of the functions that match the filter. Using '*' as a filter will print the docstrings for all functions.
30
+ Print a list of function names in alphabetical order. If method_type_filter
31
+ is specified, print the docstrings of the functions that match the filter.
32
+ Using '*' as a filter will print the docstrings for all functions.
31
33
 
32
34
  Parameters:
33
- method_type_filter: Optional filter string, comma-separated to select docstring types, or '*' for all.
35
+ method_type_filter: Optional filter string representing a function name,
36
+ or '*' to display docstrings for all functions.
34
37
  """
35
38
  # Get the current module's namespace
36
39
  current_module = __name__
@@ -41,7 +44,7 @@ def docs(method_type_filter: Optional[str] = None) -> None:
41
44
  }
42
45
 
43
46
  # List of function names sorted alphabetically
44
- function_names: List[str] = sorted(local_functions.keys())
47
+ function_names = sorted(local_functions.keys())
45
48
 
46
49
  # Print function names
47
50
  print("Functions in alphabetical order:")
@@ -50,26 +53,13 @@ def docs(method_type_filter: Optional[str] = None) -> None:
50
53
 
51
54
  # If a filter is provided or '*', print the docstrings of functions
52
55
  if method_type_filter:
53
- print("\nFiltered function documentation:")
56
+ # print("\nFiltered function documentation:")
54
57
  for name, func in local_functions.items():
55
58
  docstring: Optional[str] = func.__doc__
56
59
  if docstring:
57
- if method_type_filter == '*':
58
- # Print the entire docstring for each function
60
+ if method_type_filter == '*' or method_type_filter == name:
61
+ # Print the entire docstring for the matching function
59
62
  print(f"\n{name}:\n{docstring}")
60
- else:
61
- # Extract only the first line of the docstring
62
- first_line: str = docstring.split('\n')[0]
63
- if "::" in first_line:
64
- # Find the first occurrence of "::" and split there
65
- split_index: int = first_line.find("::")
66
- function_type: str = first_line[:split_index].strip()
67
- function_type_list: List[str] = [
68
- mt.strip() for mt in method_type_filter.split(',')]
69
- if function_type in function_type_list:
70
- # Print the entire docstring if the filter matches
71
- print(f"\n{name}:\n{docstring}")
72
-
73
63
 
74
64
  def numeric_clean(df: pd.DataFrame, column_names: str, column_type: str, irregular_value_treatment: str) -> pd.DataFrame:
75
65
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.6
3
+ Version: 0.0.8
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
@@ -28,19 +28,93 @@ Requires-Dist: google-api-python-client
28
28
 
29
29
  ***By Ryan Gerard Wilson (https://ryangerardwilson.com)***
30
30
 
31
- This library provides a variety of functions for manipulating and analyzing pandas DataFrames.
31
+ This library is meant to make ML/ Data Science pipelines more readable. It assumes a linux environment, and the existence of a `rgwml.config` file for certain features (like db querying, sending data to slack, etc.)
32
32
 
33
33
  --------------------------------------------------------------------------------
34
34
 
35
35
  ## Installation
36
36
 
37
37
  Install the package using:
38
- bash
39
- pip install rgwfuncs
40
38
 
39
+ pip install rgwfuncs
41
40
 
42
41
  --------------------------------------------------------------------------------
43
42
 
43
+ ## Create a `rgwml.config` File
44
+
45
+ A `rgwml.config` file (located at `vi ~/Documents/rgwml.config) is required for MSSQL, CLICKHOUSE, MYSQL, GOOGLE BIG QUERY, SLACK, TELEGRAM, and GMAIL integrations.
46
+
47
+ {
48
+ "db_presets" : [
49
+ {
50
+ "name": "mssql_db9",
51
+ "db_type": "mssql",
52
+ "host": "",
53
+ "username": "",
54
+ "password": "",
55
+ "database": ""
56
+ },
57
+ {
58
+ "name": "clickhouse_db7",
59
+ "db_type": "clickhouse",
60
+ "host": "",
61
+ "username": "",
62
+ "password": "",
63
+ "database": ""
64
+ },
65
+ {
66
+ "name": "mysql_db2",
67
+ "db_type": "mysql",
68
+ "host": "",
69
+ "username": "",
70
+ "password": "",
71
+ "database": ""
72
+ },
73
+ {
74
+ "name": "bq_db1",
75
+ "db_type": "google_big_query",
76
+ "json_file_path": "",
77
+ "project_id": ""
78
+ }
79
+ ],
80
+ "vm_presets": [
81
+ {
82
+ "name": "main_server",
83
+ "host": "",
84
+ "ssh_user": "",
85
+ "ssh_key_path": ""
86
+ }
87
+ ],
88
+ "cloud_storage_presets": [
89
+ {
90
+ "name": "gcs_bucket_name",
91
+ "credential_path": "/path/to/your/credentials.json"
92
+ }
93
+ ],
94
+ "telegram_bot_presets": [
95
+ {
96
+ "name": "rgwml-bot",
97
+ "chat_id": "",
98
+ "bot_token": ""
99
+ }
100
+ ],
101
+ "slack_bot_presets": [
102
+ {
103
+ "name": "labs-channel",
104
+ "channel_id": "",
105
+ "bot_token": ""
106
+ }
107
+ ],
108
+ "gmail_bot_presets": [
109
+ {
110
+ "name": "info@xyz.com",
111
+ "service_account_credentials_path": "/path/to/your/credentials.json"
112
+ }
113
+ ]
114
+ }
115
+
116
+ --------------------------------------------------------------------------------
117
+
44
118
  ## Basic Usage
45
119
 
46
120
  Import the library:
File without changes