rdxz2-utill 0.1.3__py3-none-any.whl → 0.1.4__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.

Potentially problematic release.


This version of rdxz2-utill might be problematic. Click here for more details.

utill/cmd/utill.py CHANGED
@@ -2,110 +2,231 @@ import click
2
2
 
3
3
 
4
4
  @click.group()
5
- def main(): pass
5
+ def main():
6
+ pass
6
7
 
7
8
 
8
9
  # MARK: Conf
9
10
 
10
11
 
11
- @main.group('conf', help='Configure this library')
12
- def main__conf(): pass
13
- @main__conf.command('init', help='Initialize env files')
14
- @click.argument('mode', type=click.Choice(['google-cloud', 'postgresql', 'metabase']))
15
- def main__conf__init(**kwargs): from ._conf import _init; _init(**kwargs)
16
- @main__conf.command('list', help='List all configs')
17
- @click.option('-m', 'module', type=click.Choice(['postgresql', 'metabase']), help='List config for a specific modules')
18
- def main__conf__list(**kwargs): from ._conf import _list; _list(**kwargs)
19
- @main__conf.command('set', help='Set configuration variables')
20
- @click.option('-e', 'vars', type=(str, str), multiple=True, required=True, help='Variables -> K V')
21
- def main__conf__set(**kwargs): from ._conf import _set; _set(**kwargs)
12
+ @main.group("conf", help="Configure this library")
13
+ def main__conf():
14
+ pass
15
+
16
+
17
+ @main__conf.command("init", help="Initialize env files")
18
+ @click.argument("mode", type=click.Choice(["google-cloud", "postgresql", "metabase"]))
19
+ def main__conf__init(**kwargs):
20
+ from ._conf import _init
21
+
22
+ _init(**kwargs)
23
+
24
+
25
+ @main__conf.command("list", help="List all configs")
26
+ @click.option(
27
+ "-m",
28
+ "module",
29
+ type=click.Choice(["postgresql", "metabase"]),
30
+ help="List config for a specific modules",
31
+ )
32
+ def main__conf__list(**kwargs):
33
+ from ._conf import _list
34
+
35
+ _list(**kwargs)
36
+
37
+
38
+ @main__conf.command("set", help="Set configuration variables")
39
+ @click.option(
40
+ "-e", "vars", type=(str, str), multiple=True, required=True, help="Variables -> K V"
41
+ )
42
+ def main__conf__set(**kwargs):
43
+ from ._conf import _set
44
+
45
+ _set(**kwargs)
22
46
 
23
47
 
24
48
  # MARK: Metabase
25
49
 
26
50
 
27
- @main.group('mb', help='Metabase utility commands')
28
- def main__mb(): pass
29
- @main__mb.command('julo-grant', help='Grant access to Metabase questions/collections/dashboards')
30
- @click.option('-u', '--email', 'emails', type=str, multiple=True, help='User emails')
31
- @click.option('-l', '--url', 'urls', type=str, multiple=True, help='URLs')
32
- def main__mb__grant(**kwargs): from ._mb import _grant; _grant(**kwargs)
33
- @main__mb.command('copy-permissions', help='Copy all permissions from one user to another')
34
- @click.argument('src_email', type=str)
35
- @click.argument('dst_emails', type=str, nargs=-1)
36
- def main__mb__copy_permissions(**kwargs): from ._mb import _copy_permissions; _copy_permissions(**kwargs)
37
- @main__mb.command('reset-password', help='Reset Metabase user password')
38
- @click.option('-u', '--email', 'emails', type=str, required=True, multiple=True, help='User emails')
39
- def main__mb__reset_password(**kwargs): from ._mb import _reset_password; _reset_password(**kwargs)
40
- @main__mb.command('deactivate-user', help='Deactivate Metabase user')
41
- @click.option('-u', '--email', 'emails', type=str, required=True, multiple=True, help='User emails')
42
- def main__mb__deactivate_user(**kwargs): from ._mb import _deactivate_user; _deactivate_user(**kwargs)
51
+ @main.group("mb", help="Metabase utility commands")
52
+ def main__mb():
53
+ pass
54
+
55
+
56
+ @main__mb.command(
57
+ "jl-grant", help="Grant access to Metabase questions/collections/dashboards"
58
+ )
59
+ @click.option("-u", "--email", "emails", type=str, multiple=True, help="User emails")
60
+ @click.option("-l", "--url", "urls", type=str, multiple=True, help="URLs")
61
+ @click.option(
62
+ "-c",
63
+ "create_user_if_not_exists",
64
+ type=bool,
65
+ is_flag=True,
66
+ help="Create user if not exists, also reactivate user if it's already exists default: False",
67
+ )
68
+ def main__mb__grant(**kwargs):
69
+ from ._mb import _jl_grant
70
+
71
+ _jl_grant(**kwargs)
72
+
73
+
74
+ @main__mb.command(
75
+ "copy-permissions", help="Copy all permissions from one user to another"
76
+ )
77
+ @click.argument("src_email", type=str)
78
+ @click.argument("dst_emails", type=str, nargs=-1)
79
+ def main__mb__copy_permissions(**kwargs):
80
+ from ._mb import _copy_permissions
81
+
82
+ _copy_permissions(**kwargs)
83
+
84
+
85
+ @main__mb.command("reset-password", help="Reset Metabase user password")
86
+ @click.option(
87
+ "-u",
88
+ "--email",
89
+ "emails",
90
+ type=str,
91
+ required=True,
92
+ multiple=True,
93
+ help="User emails",
94
+ )
95
+ def main__mb__reset_password(**kwargs):
96
+ from ._mb import _reset_password
97
+
98
+ _reset_password(**kwargs)
99
+
100
+
101
+ @main__mb.command("disable-user", help="Disable Metabase user")
102
+ @click.option(
103
+ "-u",
104
+ "--email",
105
+ "emails",
106
+ type=str,
107
+ required=True,
108
+ multiple=True,
109
+ help="User emails",
110
+ )
111
+ def main__mb__disable_user(**kwargs):
112
+ from ._mb import _disable_user
113
+
114
+ _disable_user(**kwargs)
43
115
 
44
116
 
45
117
  # MARK: PG
46
118
 
47
119
 
48
- @main.group('pg', help='PostgreSQL utility')
49
- def main__pg(): pass
50
- @main__pg.command('pg-to-pg', help='Copy table from one PG instance to another')
51
- @click.argument('src_profile', type=str)
52
- @click.argument('src_table', type=str)
53
- @click.argument('dst_profile', type=str)
54
- @click.argument('dst_table', type=str)
55
- @click.option('-c', '--columns', type=str, default='*', help='Columns to copy')
56
- def main__pg__pg_to_pg(**kwargs): from ._pg import _pg_to_pg; _pg_to_pg(**kwargs)
57
- @main__pg.command('upload-csv', help='Upload CSV file into PG table')
58
- @click.argument('profile', type=str)
59
- @click.argument('src_filename', type=click.Path())
60
- @click.argument('dst_table', type=str)
61
- def main__pg__upload_csv(**kwargs): from ._pg import _upload_csv; _upload_csv(**kwargs)
120
+ @main.group("pg", help="PostgreSQL utility")
121
+ def main__pg():
122
+ pass
123
+
124
+
125
+ @main__pg.command("pg-to-pg", help="Copy table from one PG instance to another")
126
+ @click.argument("src_profile", type=str)
127
+ @click.argument("src_table", type=str)
128
+ @click.argument("dst_profile", type=str)
129
+ @click.argument("dst_table", type=str)
130
+ @click.option("-c", "--columns", type=str, default="*", help="Columns to copy")
131
+ def main__pg__pg_to_pg(**kwargs):
132
+ from ._pg import _pg_to_pg
133
+
134
+ _pg_to_pg(**kwargs)
135
+
136
+
137
+ @main__pg.command("upload-csv", help="Upload CSV file into PG table")
138
+ @click.argument("profile", type=str)
139
+ @click.argument("src_filename", type=click.Path())
140
+ @click.argument("dst_table", type=str)
141
+ def main__pg__upload_csv(**kwargs):
142
+ from ._pg import _upload_csv
143
+
144
+ _upload_csv(**kwargs)
62
145
 
63
146
 
64
147
  # MARK: BQ
65
148
 
66
149
 
67
- @main.group('bq', help='BigQuery utility')
68
- def main__bq(): pass
69
- @main__bq.command('upload-csv', help='Upload CSV file into BQ table')
70
- @click.argument('src_filename', type=click.Path())
71
- @click.argument('dst_table_fqn', type=str)
72
- @click.option('-c', 'columns', type=(str, str), required=True, multiple=True, help='Columns -> Name DataType')
73
- @click.option('--partition-col', 'partition_col', type=str, help='Partition column')
74
- @click.option('--cluster-col', 'cluster_cols', type=str, multiple=True, help='Cluster column(s)')
75
- @click.option('--project', type=str, help='Billing project')
76
- def main__bq__upload_csv(**kwargs): from ._bq import _upload_csv; _upload_csv(**kwargs)
77
- @main__bq.command('download-table', help='Download a BQ table into CSV file')
78
- @click.argument('src_table_fqn', type=str)
79
- @click.argument('dst_filename', type=str)
80
- @click.option('--project', type=str, help='Billing project')
81
- def main__bq__download_table(**kwargs): from ._bq import _download_table; _download_table(**kwargs)
150
+ @main.group("bq", help="BigQuery utility")
151
+ def main__bq():
152
+ pass
153
+
154
+
155
+ @main__bq.command("upload-csv", help="Upload CSV file into BQ table")
156
+ @click.argument("src_filename", type=click.Path())
157
+ @click.argument("dst_table_fqn", type=str)
158
+ @click.option(
159
+ "-c",
160
+ "columns",
161
+ type=(str, str),
162
+ required=True,
163
+ multiple=True,
164
+ help="Columns -> Name DataType",
165
+ )
166
+ @click.option("--partition-col", "partition_col", type=str, help="Partition column")
167
+ @click.option(
168
+ "--cluster-col", "cluster_cols", type=str, multiple=True, help="Cluster column(s)"
169
+ )
170
+ @click.option("--project", type=str, help="Billing project")
171
+ def main__bq__upload_csv(**kwargs):
172
+ from ._bq import _upload_csv
173
+
174
+ _upload_csv(**kwargs)
175
+
176
+
177
+ @main__bq.command("download-table", help="Download a BQ table into CSV file")
178
+ @click.argument("src_table_fqn", type=str)
179
+ @click.argument("dst_filename", type=str)
180
+ @click.option("--project", type=str, help="Billing project")
181
+ def main__bq__download_table(**kwargs):
182
+ from ._bq import _download_table
183
+
184
+ _download_table(**kwargs)
82
185
 
83
186
 
84
187
  # MARK: Encyrption
85
188
 
86
189
 
87
- @main.group('enc', help='Encryption utility')
88
- def main__enc(): pass
89
- @main__enc.command('encrypt', help='Encrypt a string / file')
90
- @click.argument('src', type=str)
91
- @click.option('-p', 'password', type=str, required=True, help='The password')
92
- def main__enc__encrypt(**kwargs): from ._enc import _encrypt; _encrypt(**kwargs)
190
+ @main.group("enc", help="Encryption utility")
191
+ def main__enc():
192
+ pass
193
+
194
+
195
+ @main__enc.command("encrypt", help="Encrypt a string / file")
196
+ @click.argument("src", type=str)
197
+ @click.option("-p", "password", type=str, required=True, help="The password")
198
+ def main__enc__encrypt(**kwargs):
199
+ from ._enc import _encrypt
200
+
201
+ _encrypt(**kwargs)
93
202
 
94
203
 
95
204
  # MARK: Other utilities
96
205
 
97
206
 
98
- @main.command('random', help='Generate random string')
99
- @click.option('-l', 'length', type=int, default=32, help='Length of the random string')
100
- @click.option('-a', 'alphanum', is_flag=True, default=False, help='Use alphanumeric only (a-Z, 0-9)')
101
- def main__random(**kwargs): from ._main import _random; _random(**kwargs)
207
+ @main.command("random", help="Generate random string")
208
+ @click.option("-l", "length", type=int, default=32, help="Length of the random string")
209
+ @click.option(
210
+ "-a",
211
+ "alphanum",
212
+ is_flag=True,
213
+ default=False,
214
+ help="Use alphanumeric only (a-Z, 0-9)",
215
+ )
216
+ def main__random(**kwargs):
217
+ from ._main import _random
218
+
219
+ _random(**kwargs)
220
+
102
221
 
222
+ @main.command("unique", help="Get unique values")
223
+ @click.argument("strings", nargs=-1)
224
+ @click.option("-s", "sort", type=bool, is_flag=True, help="Sort the output")
225
+ def main__unique(**kwargs):
226
+ from ._main import _unique
103
227
 
104
- @main.command('unique', help='Get unique values')
105
- @click.argument('strings', nargs=-1)
106
- @click.option('-s', 'sort', type=bool, is_flag=True, help='Sort the output')
107
- def main__unique(**kwargs): from ._main import _unique; _unique(**kwargs)
228
+ _unique(**kwargs)
108
229
 
109
230
 
110
- if __name__ == '__main__':
231
+ if __name__ == "__main__":
111
232
  main()