sweatstack 0.50.0__py3-none-any.whl → 0.52.0__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.
sweatstack/client.py CHANGED
@@ -647,7 +647,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
647
647
  if self.api_key:
648
648
  headers["Authorization"] = f"Bearer {self.api_key}"
649
649
 
650
- with httpx.Client(base_url=self.url, headers=headers) as client:
650
+ with httpx.Client(base_url=self.url, headers=headers, timeout=60) as client:
651
651
  yield client
652
652
 
653
653
  def _print_response_and_raise(self, response: httpx.Response):
sweatstack/streamlit.py CHANGED
@@ -50,7 +50,7 @@ class StreamlitAuth:
50
50
  self.api_key = st.session_state.get("sweatstack_api_key")
51
51
  self.client = Client(self.api_key, streamlit_compatible=True)
52
52
 
53
- def _show_sweatstack_logout(self):
53
+ def logout_button(self):
54
54
  if st.button("Logout"):
55
55
  self.api_key = None
56
56
  self.client = Client(streamlit_compatible=True)
@@ -146,7 +146,7 @@ class StreamlitAuth:
146
146
  """
147
147
  return self.api_key is not None
148
148
 
149
- def authenticate(self, login_label: str | None = None):
149
+ def authenticate(self, login_label: str | None = None, show_logout: bool = True):
150
150
  """Authenticates the user with SweatStack.
151
151
 
152
152
  This method handles the authentication flow for SweatStack in a Streamlit app.
@@ -168,7 +168,8 @@ class StreamlitAuth:
168
168
  if not st.session_state.get("sweatstack_auth_toast_shown", False):
169
169
  st.toast("SweatStack authentication successful!", icon="✅")
170
170
  st.session_state["sweatstack_auth_toast_shown"] = True
171
- self._show_sweatstack_logout()
171
+ if show_logout:
172
+ self.logout_button()
172
173
  elif code := st.query_params.get("code"):
173
174
  self._exchange_token(code)
174
175
  st.query_params.clear()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sweatstack
3
- Version: 0.50.0
3
+ Version: 0.52.0
4
4
  Summary: The official Python client for SweatStack
5
5
  Author-email: Aart Goossens <aart@gssns.io>
6
6
  Requires-Python: >=3.9
@@ -1,17 +1,17 @@
1
1
  sweatstack/__init__.py,sha256=tiVfgKlswRPaDMEy0gA7u8rveqEYZTA_kyB9lJ3J6Sc,21
2
2
  sweatstack/cli.py,sha256=N1NWOgEZR2yaJvIXxo9qvp_jFlypZYb0nujpbVNYQ6A,720
3
- sweatstack/client.py,sha256=oIp1aoQzVGcMyXYqJg_LNq3624DSIllAWhi_g1iRJWs,54685
3
+ sweatstack/client.py,sha256=ezfEhZvott3daiv5u_LjoW1BQ6XWo5abM2dZxvi9QjA,54697
4
4
  sweatstack/constants.py,sha256=fGO6ksOv5HeISv9lHRoYm4besW1GTveXS8YD3K0ljg0,41
5
5
  sweatstack/ipython_init.py,sha256=OtBB9dQvyLXklD4kA2x1swaVtU9u73fG4V4-zz4YRAg,139
6
6
  sweatstack/jupyterlab_oauth2_startup.py,sha256=YcjXvzeZ459vL_dCkFi1IxX_RNAu80ZX9rwa0OXJfTM,1023
7
7
  sweatstack/openapi_schemas.py,sha256=VvquBdbssdB9D1KeJYQCx51hy1Df4SS0PjzGWXcUaew,46221
8
8
  sweatstack/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  sweatstack/schemas.py,sha256=44sXrNCYR0qtDsH8sUKR8df9zpcVA-TimkinXJBesOg,3683
10
- sweatstack/streamlit.py,sha256=_PER03s0dYu5eF1MZdewPDqSvYHqMr0lZLu_EnGit3Y,13257
10
+ sweatstack/streamlit.py,sha256=AaVFkNN0iO3oFBMTBWra4pkaQbSZQnrgHqsab50Zm48,13295
11
11
  sweatstack/sweatshell.py,sha256=MYLNcWbOdceqKJ3S0Pe8dwHXEeYsGJNjQoYUXpMTftA,333
12
12
  sweatstack/utils.py,sha256=AwHRdC1ziOZ5o9RBIB21Uxm-DoClVRAJSVvgsmSmvps,1801
13
13
  sweatstack/Sweat Stack examples/Getting started.ipynb,sha256=k2hiSffWecoQ0VxjdpDcgFzBXDQiYEebhnAYlu8cgX8,6335204
14
- sweatstack-0.50.0.dist-info/METADATA,sha256=2U6hV_PT2DR5SPnJ8bdKlrIF7Iqded55SI6HOMdQ4x8,852
15
- sweatstack-0.50.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- sweatstack-0.50.0.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
17
- sweatstack-0.50.0.dist-info/RECORD,,
14
+ sweatstack-0.52.0.dist-info/METADATA,sha256=ieZhiIuvwhcsQyuwGuN3kGo4xOlSVnXldZzB_nthBtE,852
15
+ sweatstack-0.52.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ sweatstack-0.52.0.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
17
+ sweatstack-0.52.0.dist-info/RECORD,,