sweatstack 0.17.0__tar.gz → 0.19.0__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.
Files changed (28) hide show
  1. {sweatstack-0.17.0 → sweatstack-0.19.0}/PKG-INFO +5 -5
  2. sweatstack-0.19.0/playground/.ipynb_checkpoints/Untitled-checkpoint.ipynb +304 -0
  3. sweatstack-0.19.0/playground/Sweat Stack examples/Getting started.ipynb +28784 -0
  4. sweatstack-0.19.0/playground/Untitled.ipynb +340 -0
  5. sweatstack-0.19.0/playground/hello.py +6 -0
  6. sweatstack-0.19.0/playground/pyproject.toml +12 -0
  7. {sweatstack-0.17.0 → sweatstack-0.19.0}/pyproject.toml +9 -6
  8. sweatstack-0.19.0/src/sweatstack/Sweat Stack examples/Getting started.ipynb +28784 -0
  9. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/client.py +70 -3
  10. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/openapi_schemas.py +31 -17
  11. sweatstack-0.19.0/src/sweatstack/py.typed +0 -0
  12. sweatstack-0.19.0/src/sweatstack/schemas.py +3 -0
  13. {sweatstack-0.17.0 → sweatstack-0.19.0}/uv.lock +22 -5
  14. sweatstack-0.17.0/src/sweatstack/schemas.py +0 -3
  15. {sweatstack-0.17.0 → sweatstack-0.19.0}/.gitignore +0 -0
  16. {sweatstack-0.17.0 → sweatstack-0.19.0}/.python-version +0 -0
  17. {sweatstack-0.17.0 → sweatstack-0.19.0}/DEVELOPMENT.md +0 -0
  18. {sweatstack-0.17.0 → sweatstack-0.19.0}/Makefile +0 -0
  19. {sweatstack-0.17.0 → sweatstack-0.19.0}/README.md +0 -0
  20. /sweatstack-0.17.0/src/sweatstack/py.typed → /sweatstack-0.19.0/playground/README.md +0 -0
  21. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/__init__.py +0 -0
  22. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/cli.py +0 -0
  23. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/constants.py +0 -0
  24. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/ipython_init.py +0 -0
  25. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/jupyterlab_oauth2_startup.py +0 -0
  26. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/streamlit.py +0 -0
  27. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/sweatshell.py +0 -0
  28. {sweatstack-0.17.0 → sweatstack-0.19.0}/src/sweatstack/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sweatstack
3
- Version: 0.17.0
3
+ Version: 0.19.0
4
4
  Summary: The official Python client for SweatStack
5
5
  Author-email: Aart Goossens <aart@gssns.io>
6
6
  Requires-Python: >=3.12
@@ -8,10 +8,10 @@ Requires-Dist: httpx>=0.28.1
8
8
  Requires-Dist: pandas>=2.2.3
9
9
  Requires-Dist: pyarrow>=19.0.0
10
10
  Requires-Dist: pydantic>=2.10.5
11
- Provides-Extra: jupyterlab
12
- Requires-Dist: ipython>=8.31.0; extra == 'jupyterlab'
13
- Requires-Dist: jupyterlab>=4.3.4; extra == 'jupyterlab'
14
- Requires-Dist: matplotlib; extra == 'jupyterlab'
11
+ Provides-Extra: jupyter
12
+ Requires-Dist: ipython>=8.31.0; extra == 'jupyter'
13
+ Requires-Dist: jupyterlab>=4.3.4; extra == 'jupyter'
14
+ Requires-Dist: matplotlib>=3.10.0; extra == 'jupyter'
15
15
  Provides-Extra: streamlit
16
16
  Requires-Dist: streamlit>=1.42.0; extra == 'streamlit'
17
17
  Description-Content-Type: text/markdown
@@ -0,0 +1,304 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "e6b6073d-8dfe-47c1-a119-36a52e7a3027",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import sweatstack as ss"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 2,
16
+ "id": "7b996cc3-77a9-4dfa-8994-bdfd62e7acc2",
17
+ "metadata": {},
18
+ "outputs": [
19
+ {
20
+ "data": {
21
+ "application/vnd.jupyter.widget-view+json": {
22
+ "model_id": "5859693fa419439da7eed3caec5c83f8",
23
+ "version_major": 2,
24
+ "version_minor": 0
25
+ },
26
+ "text/plain": [
27
+ "Dropdown(description='Select:', options=(('Aart Goossens', UserSummary(id='367e641960564f7c', first_name='Aart…"
28
+ ]
29
+ },
30
+ "metadata": {},
31
+ "output_type": "display_data"
32
+ },
33
+ {
34
+ "name": "stdout",
35
+ "output_type": "stream",
36
+ "text": [
37
+ "False id='367e641960564f7c' first_name='Aart' last_name='Goossens' scopes=[<Scope.data_read: 'data:read'>, <Scope.data_write: 'data:write'>, <Scope.openid: 'openid'>, <Scope.profile: 'profile'>] display_name='Aart Goossens'\n"
38
+ ]
39
+ },
40
+ {
41
+ "ename": "KeyboardInterrupt",
42
+ "evalue": "",
43
+ "output_type": "error",
44
+ "traceback": [
45
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
46
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
47
+ "Cell \u001b[0;32mIn[2], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mss\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mswitch_user\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
48
+ "File \u001b[0;32m~/projects/sweatstack-python/src/sweatstack/client.py:689\u001b[0m, in \u001b[0;36m_generate_singleton_methods.<locals>.create_singleton_method.<locals>.singleton_method\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 687\u001b[0m \u001b[38;5;129m@wraps\u001b[39m(bound_method)\n\u001b[1;32m 688\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21msingleton_method\u001b[39m(\u001b[38;5;241m*\u001b[39margs: Any, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Any) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Any:\n\u001b[0;32m--> 689\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mbound_method\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
49
+ "File \u001b[0;32m~/projects/sweatstack-python/src/sweatstack/client.py:174\u001b[0m, in \u001b[0;36mDelegationMixin.switch_user\u001b[0;34m(self, user_id)\u001b[0m\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m user_id \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 173\u001b[0m users \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlist_users()\n\u001b[0;32m--> 174\u001b[0m selected_user \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_interactive_dropdown\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 175\u001b[0m \u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[43m(\u001b[49m\u001b[43muser\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdisplay_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43muser\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43muser\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43musers\u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 176\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 177\u001b[0m user_id \u001b[38;5;241m=\u001b[39m selected_user\u001b[38;5;241m.\u001b[39mid\n\u001b[1;32m 179\u001b[0m token_response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_delegated_token(user_id)\n",
50
+ "File \u001b[0;32m~/projects/sweatstack-python/src/sweatstack/client.py:155\u001b[0m, in \u001b[0;36mJupyterInteractivityMixin._interactive_dropdown\u001b[0;34m(self, options, selected)\u001b[0m\n\u001b[1;32m 153\u001b[0m \u001b[38;5;28mprint\u001b[39m(selection_made, selected_user)\n\u001b[1;32m 154\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m selection_made:\n\u001b[0;32m--> 155\u001b[0m \u001b[43mtime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msleep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0.1\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 157\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m selected_user \u001b[38;5;129;01mor\u001b[39;00m dropdown\u001b[38;5;241m.\u001b[39mvalue\n",
51
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
52
+ ]
53
+ }
54
+ ],
55
+ "source": [
56
+ "ss.switch_user()"
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "code",
61
+ "execution_count": null,
62
+ "id": "f1aba308-26aa-4e02-ad0d-0affc25d70c3",
63
+ "metadata": {},
64
+ "outputs": [],
65
+ "source": [
66
+ "ss.get_latest_activity()"
67
+ ]
68
+ },
69
+ {
70
+ "cell_type": "code",
71
+ "execution_count": 5,
72
+ "id": "4cc66539-6b9b-4da1-9ea3-76b0921445bb",
73
+ "metadata": {},
74
+ "outputs": [
75
+ {
76
+ "name": "stdout",
77
+ "output_type": "stream",
78
+ "text": [
79
+ "Hello, please push the continue button\n"
80
+ ]
81
+ },
82
+ {
83
+ "data": {
84
+ "application/vnd.jupyter.widget-view+json": {
85
+ "model_id": "20b55657b57a4618b94024f2c26be2da",
86
+ "version_major": 2,
87
+ "version_minor": 0
88
+ },
89
+ "text/plain": [
90
+ "Button(description='continue', style=ButtonStyle())"
91
+ ]
92
+ },
93
+ "metadata": {},
94
+ "output_type": "display_data"
95
+ },
96
+ {
97
+ "data": {
98
+ "application/vnd.jupyter.widget-view+json": {
99
+ "model_id": "5b5feae0d01145a4b9ef1f6bbc2a5595",
100
+ "version_major": 2,
101
+ "version_minor": 0
102
+ },
103
+ "text/plain": [
104
+ "Output()"
105
+ ]
106
+ },
107
+ "execution_count": 5,
108
+ "metadata": {},
109
+ "output_type": "execute_result"
110
+ }
111
+ ],
112
+ "source": [
113
+ "import ipywidgets as widgets\n",
114
+ "from IPython.display import display\n",
115
+ "output = widgets.Output()\n",
116
+ "\n",
117
+ "@output.capture(clear_output=False,wait=True) # based on https://github.com/jupyter-widgets/ipywidgets/issues/1846 and https://ipywidgets.readthedocs.io/en/latest/examples/Output%20Widget.html\n",
118
+ "def sayHello(b):\n",
119
+ " print(\"You have pushed the button, congratulations I guess.\")\n",
120
+ "\n",
121
+ "run_button = widgets.Button(\n",
122
+ " description = 'continue'\n",
123
+ ")\n",
124
+ "print(\"Hello, please push the continue button\")\n",
125
+ "run_button.on_click(sayHello)\n",
126
+ "display(run_button)\n",
127
+ "output"
128
+ ]
129
+ },
130
+ {
131
+ "cell_type": "code",
132
+ "execution_count": 6,
133
+ "id": "dd46e152-2198-48ef-ac1f-37187241dede",
134
+ "metadata": {},
135
+ "outputs": [],
136
+ "source": [
137
+ "a = \"b\""
138
+ ]
139
+ },
140
+ {
141
+ "cell_type": "code",
142
+ "execution_count": 11,
143
+ "id": "19839a77-ca8a-40e1-aba2-1bf6161b0932",
144
+ "metadata": {},
145
+ "outputs": [
146
+ {
147
+ "data": {
148
+ "application/vnd.jupyter.widget-view+json": {
149
+ "model_id": "a996ea772a264e10a61c16fa6982fb1b",
150
+ "version_major": 2,
151
+ "version_minor": 0
152
+ },
153
+ "text/plain": [
154
+ "Dropdown(description='Number:', index=1, options=('1', '2', '3'), value='2')"
155
+ ]
156
+ },
157
+ "metadata": {},
158
+ "output_type": "display_data"
159
+ }
160
+ ],
161
+ "source": [
162
+ "a = widgets.Dropdown(\n",
163
+ " options=['1', '2', '3'],\n",
164
+ " value='2',\n",
165
+ " description='Number:',\n",
166
+ " disabled=False,\n",
167
+ ")\n",
168
+ "display(a)"
169
+ ]
170
+ },
171
+ {
172
+ "cell_type": "code",
173
+ "execution_count": 1,
174
+ "id": "bca65172-a2fa-44ce-a6f6-09979b9f3c94",
175
+ "metadata": {},
176
+ "outputs": [
177
+ {
178
+ "name": "stdout",
179
+ "output_type": "stream",
180
+ "text": [
181
+ "Please select an option from the dropdown...\n"
182
+ ]
183
+ },
184
+ {
185
+ "data": {
186
+ "application/vnd.jupyter.widget-view+json": {
187
+ "model_id": "7011c494ad5d411bb28ad9118423b00a",
188
+ "version_major": 2,
189
+ "version_minor": 0
190
+ },
191
+ "text/plain": [
192
+ "VBox(children=(Dropdown(description='Select:', options=('Option 1', 'Option 2', 'Option 3'), value='Option 1')…"
193
+ ]
194
+ },
195
+ "metadata": {},
196
+ "output_type": "display_data"
197
+ },
198
+ {
199
+ "ename": "KeyboardInterrupt",
200
+ "evalue": "",
201
+ "output_type": "error",
202
+ "traceback": [
203
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
204
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
205
+ "Cell \u001b[0;32mIn[1], line 59\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[38;5;66;03m# Usage\u001b[39;00m\n\u001b[1;32m 58\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPlease select an option from the dropdown...\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 59\u001b[0m selection \u001b[38;5;241m=\u001b[39m \u001b[43mget_selection_with_interact\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 60\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mProcessing continues with selection: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mselection\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n",
206
+ "Cell \u001b[0;32mIn[1], line 53\u001b[0m, in \u001b[0;36mget_selection_with_interact\u001b[0;34m(options)\u001b[0m\n\u001b[1;32m 51\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m done[\u001b[38;5;241m0\u001b[39m]:\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01mtime\u001b[39;00m\n\u001b[0;32m---> 53\u001b[0m \u001b[43mtime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msleep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0.1\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 55\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result[\u001b[38;5;241m0\u001b[39m]\n",
207
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
208
+ ]
209
+ }
210
+ ],
211
+ "source": [
212
+ "import time\n",
213
+ "\n",
214
+ "import ipywidgets as widgets\n",
215
+ "from IPython.display import display\n",
216
+ "\n",
217
+ "def get_selection_with_interact(options=['Option 1', 'Option 2', 'Option 3']):\n",
218
+ " \"\"\"\n",
219
+ " Uses interact to create a dropdown that blocks until selection is complete.\n",
220
+ " \"\"\"\n",
221
+ " # Set up the result container\n",
222
+ " result = [None]\n",
223
+ " done = [False]\n",
224
+ " \n",
225
+ " # Create a submit button widget\n",
226
+ " submit_button = widgets.Button(\n",
227
+ " description='Submit',\n",
228
+ " button_style='success',\n",
229
+ " tooltip='Click to submit your selection'\n",
230
+ " )\n",
231
+ " \n",
232
+ " # Create output for status messages\n",
233
+ " output = widgets.Output()\n",
234
+ " \n",
235
+ " # Create dropdown\n",
236
+ " dropdown = widgets.Dropdown(\n",
237
+ " options=options,\n",
238
+ " description='Select:',\n",
239
+ " disabled=False\n",
240
+ " )\n",
241
+ " \n",
242
+ " # Define button click handler\n",
243
+ " def on_submit_clicked(b):\n",
244
+ " result[0] = dropdown.value\n",
245
+ " done[0] = True\n",
246
+ " with output:\n",
247
+ " print(f\"Selection submitted: {result[0]}\")\n",
248
+ " print(\"You can now run the next cell.\")\n",
249
+ " \n",
250
+ " # Connect the button click to the handler\n",
251
+ " submit_button.on_click(on_submit_clicked)\n",
252
+ " \n",
253
+ " # Display all widgets\n",
254
+ " display(widgets.VBox([dropdown, submit_button, output]))\n",
255
+ " \n",
256
+ " # Wait for selection\n",
257
+ " with output:\n",
258
+ " time.sleep(0.1)\n",
259
+ " print(\"Please make a selection and click Submit...\")\n",
260
+ " \n",
261
+ " # Block until selection is made\n",
262
+ " while not done[0]:\n",
263
+ " import time\n",
264
+ " time.sleep(0.1)\n",
265
+ " \n",
266
+ " return result[0]\n",
267
+ "\n",
268
+ "# Usage\n",
269
+ "print(\"Please select an option from the dropdown...\")\n",
270
+ "selection = get_selection_with_interact()\n",
271
+ "print(f\"Processing continues with selection: {selection}\")"
272
+ ]
273
+ },
274
+ {
275
+ "cell_type": "code",
276
+ "execution_count": null,
277
+ "id": "d310c174-f6f7-4d11-b7c5-13daae23498a",
278
+ "metadata": {},
279
+ "outputs": [],
280
+ "source": []
281
+ }
282
+ ],
283
+ "metadata": {
284
+ "kernelspec": {
285
+ "display_name": "Python 3 (ipykernel)",
286
+ "language": "python",
287
+ "name": "python3"
288
+ },
289
+ "language_info": {
290
+ "codemirror_mode": {
291
+ "name": "ipython",
292
+ "version": 3
293
+ },
294
+ "file_extension": ".py",
295
+ "mimetype": "text/x-python",
296
+ "name": "python",
297
+ "nbconvert_exporter": "python",
298
+ "pygments_lexer": "ipython3",
299
+ "version": "3.12.5"
300
+ }
301
+ },
302
+ "nbformat": 4,
303
+ "nbformat_minor": 5
304
+ }