sweatstack 0.42.0__tar.gz → 0.43.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 (27) hide show
  1. {sweatstack-0.42.0 → sweatstack-0.43.0}/PKG-INFO +1 -1
  2. {sweatstack-0.42.0 → sweatstack-0.43.0}/pyproject.toml +1 -1
  3. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/streamlit.py +11 -7
  4. {sweatstack-0.42.0 → sweatstack-0.43.0}/.gitignore +0 -0
  5. {sweatstack-0.42.0 → sweatstack-0.43.0}/.python-version +0 -0
  6. {sweatstack-0.42.0 → sweatstack-0.43.0}/DEVELOPMENT.md +0 -0
  7. {sweatstack-0.42.0 → sweatstack-0.43.0}/Makefile +0 -0
  8. {sweatstack-0.42.0 → sweatstack-0.43.0}/README.md +0 -0
  9. {sweatstack-0.42.0 → sweatstack-0.43.0}/playground/.ipynb_checkpoints/Untitled-checkpoint.ipynb +0 -0
  10. {sweatstack-0.42.0 → sweatstack-0.43.0}/playground/README.md +0 -0
  11. {sweatstack-0.42.0 → sweatstack-0.43.0}/playground/Sweat Stack examples/Getting started.ipynb +0 -0
  12. {sweatstack-0.42.0 → sweatstack-0.43.0}/playground/Untitled.ipynb +0 -0
  13. {sweatstack-0.42.0 → sweatstack-0.43.0}/playground/hello.py +0 -0
  14. {sweatstack-0.42.0 → sweatstack-0.43.0}/playground/pyproject.toml +0 -0
  15. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/Sweat Stack examples/Getting started.ipynb +0 -0
  16. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/__init__.py +0 -0
  17. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/cli.py +0 -0
  18. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/client.py +0 -0
  19. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/constants.py +0 -0
  20. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/ipython_init.py +0 -0
  21. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/jupyterlab_oauth2_startup.py +0 -0
  22. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/openapi_schemas.py +0 -0
  23. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/py.typed +0 -0
  24. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/schemas.py +0 -0
  25. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/sweatshell.py +0 -0
  26. {sweatstack-0.42.0 → sweatstack-0.43.0}/src/sweatstack/utils.py +0 -0
  27. {sweatstack-0.42.0 → sweatstack-0.43.0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sweatstack
3
- Version: 0.42.0
3
+ Version: 0.43.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,6 +1,6 @@
1
1
  [project]
2
2
  name = "sweatstack"
3
- version = "0.42.0"
3
+ version = "0.43.0"
4
4
  description = "The official Python client for SweatStack"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -60,8 +60,9 @@ class StreamlitAuth:
60
60
  def _running_on_streamlit_cloud(self):
61
61
  return os.environ.get("HOSTNAME") == "streamlit"
62
62
 
63
- def _show_sweatstack_login(self):
64
- authorization_url = self._get_authorization_url()
63
+ def _show_sweatstack_login(self, login_label: str | None = None):
64
+ authorization_url = self.get_authorization_url()
65
+ login_label = login_label or "Connect with SweatStack"
65
66
  if not self._running_on_streamlit_cloud():
66
67
  st.markdown(
67
68
  f"""
@@ -87,14 +88,14 @@ class StreamlitAuth:
87
88
  border: none;
88
89
  transition: all 0.3s ease;
89
90
  cursor: pointer;"
90
- >Login with SweatStack</a>
91
+ >{login_label}</a>
91
92
  """,
92
93
  unsafe_allow_html=True,
93
94
  )
94
95
  else:
95
- st.link_button("Login with SweatStack", authorization_url)
96
+ st.link_button(login_label, authorization_url)
96
97
 
97
- def _get_authorization_url(self):
98
+ def get_authorization_url(self):
98
99
  params = {
99
100
  "client_id": self.client_id,
100
101
  "redirect_uri": self.redirect_uri,
@@ -145,7 +146,7 @@ class StreamlitAuth:
145
146
  """
146
147
  return self.api_key is not None
147
148
 
148
- def authenticate(self):
149
+ def authenticate(self, login_label: str | None = None):
149
150
  """Authenticates the user with SweatStack.
150
151
 
151
152
  This method handles the authentication flow for SweatStack in a Streamlit app.
@@ -157,6 +158,9 @@ class StreamlitAuth:
157
158
  to the Streamlit app with an authorization code, which is exchanged for an
158
159
  access token.
159
160
 
161
+ Args:
162
+ login_label: The label to display on the login button. Defaults to "Login with SweatStack".
163
+
160
164
  Returns:
161
165
  None
162
166
  """
@@ -170,7 +174,7 @@ class StreamlitAuth:
170
174
  st.query_params.clear()
171
175
  st.rerun()
172
176
  else:
173
- self._show_sweatstack_login()
177
+ self._show_sweatstack_login(login_label)
174
178
 
175
179
  def select_user(self):
176
180
  """Displays a user selection dropdown and switches the client to the selected user.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes