fullscript.spellbook 2.1.4__tar.gz → 2.1.6__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.
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/PKG-INFO +4 -3
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/documentation/drive_magic.md +1 -1
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/documentation/sheet_magic.md +4 -4
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/fullscript.spellbook.egg-info/PKG-INFO +4 -3
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/fullscript.spellbook.egg-info/requires.txt +1 -1
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/pyproject.toml +1 -1
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/requirements.txt +1 -1
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/drive_magic.py +16 -10
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/sheet_magic.py +4 -4
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/.DS_Store +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/.gitignore +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/.gitlab-ci.yml +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/.python-version +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/LICENSE +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/MANIFEST.in +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/README.md +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/documentation/db_magic.md +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/documentation/snowflake_key_pair_setup.md +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/documentation/stats_magic.md +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/fullscript.spellbook.egg-info/SOURCES.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/fullscript.spellbook.egg-info/dependency_links.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/fullscript.spellbook.egg-info/top_level.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/setup.cfg +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/.DS_Store +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/__init__.py +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/db_magic.py +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/stats_magic.py +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/utils.py +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/__init__.py +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard1.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard10.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard11.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard12.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard2.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard3.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard4.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard5.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard6.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard7.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard8.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook/wizards/wizard9.txt +0 -0
- {fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/spellbook_config.yaml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fullscript.spellbook
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.6
|
|
4
4
|
Summary: A simple package to make your life easier.
|
|
5
5
|
Author-email: Thomas Edwards <thomas.edwards@fullscript.com>, Gui Chagas <gui.chagas@fullscript.com>, David King <david.king@fullscript.com>, Meinhard Mare <meinhard.mare@fullscript.com>, Karsten Melchers <karsten.melchers@fullscript.com>
|
|
6
6
|
License: MIT
|
|
@@ -52,7 +52,7 @@ Requires-Dist: PyYAML==6.0.2
|
|
|
52
52
|
Requires-Dist: pyzmq==26.2.0
|
|
53
53
|
Requires-Dist: requests==2.32.3
|
|
54
54
|
Requires-Dist: six==1.16.0
|
|
55
|
-
Requires-Dist: snowflake-connector-python==3.
|
|
55
|
+
Requires-Dist: snowflake-connector-python==3.15.0
|
|
56
56
|
Requires-Dist: snowflake-snowpark-python==1.25.0
|
|
57
57
|
Requires-Dist: sortedcontainers==2.4.0
|
|
58
58
|
Requires-Dist: SQLAlchemy==2.0.36
|
|
@@ -116,6 +116,7 @@ Requires-Dist: scipy==1.14.1; extra == "statsmagic"
|
|
|
116
116
|
Requires-Dist: seaborn==0.13.2; extra == "statsmagic"
|
|
117
117
|
Requires-Dist: six==1.16.0; extra == "statsmagic"
|
|
118
118
|
Requires-Dist: statsmodels==0.14.4; extra == "statsmagic"
|
|
119
|
+
Dynamic: license-file
|
|
119
120
|
|
|
120
121
|
# Spellbook
|
|
121
122
|
|
|
@@ -27,7 +27,7 @@ Step-by-step:
|
|
|
27
27
|
|
|
28
28
|
4 - From the same page, download the client secret as a JSON file.
|
|
29
29
|
|
|
30
|
-
5 - Now the process is similar to what is done for `'
|
|
30
|
+
5 - Now the process is similar to what is done for `'GS_SERVICE_ACCOUNT_KEY'`. Copy the contents of the JSON file.
|
|
31
31
|
|
|
32
32
|
6 - Go to the terminal and use `pbpaste | base64 | pbcopy` to paste, encode, and copy the contents again.
|
|
33
33
|
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
## Create a Google Service account
|
|
19
19
|
To use this feature, you must create a Google service account. Instructions on how to do this are available on the Google [IAM documentation](https://cloud.google.com/iam/docs/service-accounts-create#iam-service-accounts-create-console)
|
|
20
20
|
|
|
21
|
-
## Saving Your `
|
|
22
|
-
How to save your '
|
|
21
|
+
## Saving Your `GS_SERVICE_ACCOUNT_KEY` Environment Variable
|
|
22
|
+
How to save your 'GS_SERVICE_ACCOUNT_KEY' env-var to use this code
|
|
23
23
|
|
|
24
24
|
To use Google Service Account functionality with this code, you need to save your Google Service Account JSON as an encrypted string in an environment variable. Follow these steps:
|
|
25
25
|
1.Convert the JSON File Content to a Base64-Encoded String
|
|
@@ -32,11 +32,11 @@ To use Google Service Account functionality with this code, you need to save you
|
|
|
32
32
|
|
|
33
33
|
2.Save the Encoded String as an Environment Variable
|
|
34
34
|
* Add the encoded string as an environment variable.
|
|
35
|
-
* Use a name like
|
|
35
|
+
* Use a name like GS_SERVICE_ACCOUNT_KEY for consistency.
|
|
36
36
|
|
|
37
37
|
For example, add the following line to your environment file (e.g., .env):
|
|
38
38
|
```bash
|
|
39
|
-
|
|
39
|
+
GS_SERVICE_ACCOUNT_KEY=your_base64_encoded_string
|
|
40
40
|
```
|
|
41
41
|
3.Why Base64 Encoding?
|
|
42
42
|
* Base64 ensures the JSON content is securely represented as a single string, making it compatible with environment variables.
|
{fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/fullscript.spellbook.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fullscript.spellbook
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.6
|
|
4
4
|
Summary: A simple package to make your life easier.
|
|
5
5
|
Author-email: Thomas Edwards <thomas.edwards@fullscript.com>, Gui Chagas <gui.chagas@fullscript.com>, David King <david.king@fullscript.com>, Meinhard Mare <meinhard.mare@fullscript.com>, Karsten Melchers <karsten.melchers@fullscript.com>
|
|
6
6
|
License: MIT
|
|
@@ -52,7 +52,7 @@ Requires-Dist: PyYAML==6.0.2
|
|
|
52
52
|
Requires-Dist: pyzmq==26.2.0
|
|
53
53
|
Requires-Dist: requests==2.32.3
|
|
54
54
|
Requires-Dist: six==1.16.0
|
|
55
|
-
Requires-Dist: snowflake-connector-python==3.
|
|
55
|
+
Requires-Dist: snowflake-connector-python==3.15.0
|
|
56
56
|
Requires-Dist: snowflake-snowpark-python==1.25.0
|
|
57
57
|
Requires-Dist: sortedcontainers==2.4.0
|
|
58
58
|
Requires-Dist: SQLAlchemy==2.0.36
|
|
@@ -116,6 +116,7 @@ Requires-Dist: scipy==1.14.1; extra == "statsmagic"
|
|
|
116
116
|
Requires-Dist: seaborn==0.13.2; extra == "statsmagic"
|
|
117
117
|
Requires-Dist: six==1.16.0; extra == "statsmagic"
|
|
118
118
|
Requires-Dist: statsmodels==0.14.4; extra == "statsmagic"
|
|
119
|
+
Dynamic: license-file
|
|
119
120
|
|
|
120
121
|
# Spellbook
|
|
121
122
|
|
|
@@ -183,7 +183,7 @@ six==1.16.0
|
|
|
183
183
|
# asttokens
|
|
184
184
|
# fullscript.spellbook (pyproject.toml)
|
|
185
185
|
# python-dateutil
|
|
186
|
-
snowflake-connector-python==3.
|
|
186
|
+
snowflake-connector-python==3.15.0
|
|
187
187
|
# via
|
|
188
188
|
# fullscript.spellbook (pyproject.toml)
|
|
189
189
|
# snowflake-snowpark-python
|
|
@@ -50,22 +50,22 @@ def get_service(scopes, service_account_name, auth_type='service_account', **kwa
|
|
|
50
50
|
|
|
51
51
|
# Load the configuration
|
|
52
52
|
config = load_and_parse_config(configurations='google_accounts', **kwargs)
|
|
53
|
-
|
|
53
|
+
GS_SERVICE_ACCOUNT_KEY = None
|
|
54
54
|
|
|
55
55
|
# Find the Google Sheets service account details in the configuration
|
|
56
56
|
google_accounts = config.get('google_accounts', [])
|
|
57
57
|
for gs_account in google_accounts:
|
|
58
58
|
if gs_account.get('name') == service_account_name:
|
|
59
|
-
|
|
59
|
+
GS_SERVICE_ACCOUNT_KEY = gs_account.get('service_account')
|
|
60
60
|
break
|
|
61
61
|
|
|
62
|
-
if not
|
|
62
|
+
if not GS_SERVICE_ACCOUNT_KEY:
|
|
63
63
|
raise ValueError(
|
|
64
64
|
f"Google Sheets service account '{service_account_name}' not found in configuration file.")
|
|
65
65
|
|
|
66
|
-
# creates a credentials file using the info in the env var
|
|
66
|
+
# creates a credentials file using the info in the env var GS_SERVICE_ACCOUNT_KEY
|
|
67
67
|
with open('credentials.json', 'w') as credential_file:
|
|
68
|
-
print(base64.b64decode(os.environ['
|
|
68
|
+
print(base64.b64decode(os.environ['GS_SERVICE_ACCOUNT_KEY']).decode(), file=credential_file)
|
|
69
69
|
|
|
70
70
|
# uses the file to create the scoped credentials
|
|
71
71
|
credentials = service_account.Credentials.from_service_account_file('credentials.json')
|
|
@@ -140,17 +140,23 @@ def list_folder_contents(service, folder_url, max_results=1000, show_trashed=Fal
|
|
|
140
140
|
|
|
141
141
|
# get the folder id
|
|
142
142
|
folder_id = folder_url.rsplit('/', 1)[-1]
|
|
143
|
-
|
|
144
143
|
try:
|
|
145
|
-
# get
|
|
144
|
+
# get files from GDrive
|
|
145
|
+
files = []
|
|
146
|
+
|
|
146
147
|
results = service.files().list(q=f"'{folder_id}' in parents and trashed = {str(show_trashed).lower()}",
|
|
147
148
|
pageSize=max_results, orderBy='name',
|
|
148
149
|
includeItemsFromAllDrives=True, supportsAllDrives=True,
|
|
149
|
-
fields="nextPageToken, files(id, name, mimeType, size, parents, modifiedTime)")
|
|
150
|
-
items = results.get('files', [])
|
|
150
|
+
fields="nextPageToken, files(id, name, mimeType, size, parents, modifiedTime)")
|
|
151
151
|
|
|
152
|
+
while results is not None:
|
|
153
|
+
response = results.execute()
|
|
154
|
+
files.extend(response.get('files', []))
|
|
155
|
+
results = service.files().list_next(results, response)
|
|
156
|
+
|
|
152
157
|
# returns as a DF
|
|
153
|
-
df_temp = pd.DataFrame(
|
|
158
|
+
df_temp = pd.DataFrame(files)
|
|
159
|
+
|
|
154
160
|
df_temp = df_temp.rename({'size': 'size_bytes'}, axis=1)
|
|
155
161
|
return df_temp
|
|
156
162
|
except HttpError as error:
|
|
@@ -37,21 +37,21 @@ class GSheetsHandler:
|
|
|
37
37
|
try:
|
|
38
38
|
# Load the configuration
|
|
39
39
|
config = load_and_parse_config(config_file_path=self._config_file, configurations='google_accounts')
|
|
40
|
-
|
|
40
|
+
GS_SERVICE_ACCOUNT_KEY = None
|
|
41
41
|
|
|
42
42
|
# Find the Google Sheets service account details in the configuration
|
|
43
43
|
google_accounts = config.get('google_accounts', [])
|
|
44
44
|
for gs_account in google_accounts:
|
|
45
45
|
if gs_account.get('name') == self._service_account_name:
|
|
46
|
-
|
|
46
|
+
GS_SERVICE_ACCOUNT_KEY = gs_account.get('service_account')
|
|
47
47
|
break
|
|
48
48
|
|
|
49
|
-
if not
|
|
49
|
+
if not GS_SERVICE_ACCOUNT_KEY:
|
|
50
50
|
raise ValueError(f"Google Sheets service account '{self._service_account_name}' not found in configuration file.")
|
|
51
51
|
|
|
52
52
|
# Decode and write credentials from configuration to a temporary file
|
|
53
53
|
with open("credentials.json", "w") as credential_file:
|
|
54
|
-
print(base64.b64decode(
|
|
54
|
+
print(base64.b64decode(GS_SERVICE_ACCOUNT_KEY).decode(), file=credential_file)
|
|
55
55
|
|
|
56
56
|
# Use the JSON file to authenticate on Google Sheets
|
|
57
57
|
self._gc = pygsheets.authorize(service_file="credentials.json")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/documentation/snowflake_key_pair_setup.md
RENAMED
|
File without changes
|
|
File without changes
|
{fullscript_spellbook-2.1.4 → fullscript_spellbook-2.1.6}/fullscript.spellbook.egg-info/SOURCES.txt
RENAMED
|
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
|
|
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
|
|
File without changes
|