sweatstack 0.30.1__py3-none-any.whl → 0.31.1__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
@@ -10,6 +10,7 @@ import webbrowser
10
10
  from datetime import date, datetime
11
11
  from functools import wraps
12
12
  from http.server import BaseHTTPRequestHandler, HTTPServer
13
+ from importlib.metadata import version
13
14
  from io import BytesIO
14
15
  from typing import Any, Generator, get_type_hints, List, Literal
15
16
  from urllib.parse import parse_qs, urlparse
@@ -42,6 +43,12 @@ AUTH_SUCCESSFUL_RESPONSE = """<!DOCTYPE html>
42
43
  OAUTH2_CLIENT_ID = "5382f68b0d254378"
43
44
 
44
45
 
46
+ try:
47
+ __version__ = version("sweatstack")
48
+ except ImportError:
49
+ __version__ = "unknown"
50
+
51
+
45
52
  class OAuth2Mixin:
46
53
  def login(self):
47
54
  class AuthHandler(BaseHTTPRequestHandler):
@@ -270,7 +277,9 @@ class Client(OAuth2Mixin, DelegationMixin):
270
277
  """
271
278
  Creates an httpx client with the base URL and authentication headers pre-configured.
272
279
  """
273
- headers = {}
280
+ headers = {
281
+ "User-Agent": f"python-sweatstack/{__version__}",
282
+ }
274
283
  if self.api_key:
275
284
  headers["Authorization"] = f"Bearer {self.api_key}"
276
285
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sweatstack
3
- Version: 0.30.1
3
+ Version: 0.31.1
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
  sweatstack/__init__.py,sha256=tiVfgKlswRPaDMEy0gA7u8rveqEYZTA_kyB9lJ3J6Sc,21
2
2
  sweatstack/cli.py,sha256=N1NWOgEZR2yaJvIXxo9qvp_jFlypZYb0nujpbVNYQ6A,720
3
- sweatstack/client.py,sha256=OC9ZUb7IZ8AThhKlXHrVk1oOkar-aUDF7LY3GNEC1so,23901
3
+ sweatstack/client.py,sha256=jzTjKcgfooADa9JUqKJPV2Z-HbAmNZOeqgVkk6Y89eU,24106
4
4
  sweatstack/constants.py,sha256=fGO6ksOv5HeISv9lHRoYm4besW1GTveXS8YD3K0ljg0,41
5
5
  sweatstack/ipython_init.py,sha256=zBGUlMFkdpLvsNpOpwrNaKRUpUZhzaICvH8ODJgMPcI,229
6
6
  sweatstack/jupyterlab_oauth2_startup.py,sha256=eZ6xi0Sa4hO4vUanimq0SqjduHtiywCURSDNWk_I-7s,1200
@@ -11,7 +11,7 @@ sweatstack/streamlit.py,sha256=gsgiIDW-INGTvF24ANnX5LJ17ZxnvXx95sjSmtcTlnY,8062
11
11
  sweatstack/sweatshell.py,sha256=MYLNcWbOdceqKJ3S0Pe8dwHXEeYsGJNjQoYUXpMTftA,333
12
12
  sweatstack/utils.py,sha256=3K97OSWQy5KZ97QiBbW4Kx1wDGxwyA96ZWpwIbkcQZc,2090
13
13
  sweatstack/Sweat Stack examples/Getting started.ipynb,sha256=k2hiSffWecoQ0VxjdpDcgFzBXDQiYEebhnAYlu8cgX8,6335204
14
- sweatstack-0.30.1.dist-info/METADATA,sha256=0r3IRJ3FH3sDFXNNOUqE2RdHCLxuo8Hb9IxzL3sfQYk,775
15
- sweatstack-0.30.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- sweatstack-0.30.1.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
17
- sweatstack-0.30.1.dist-info/RECORD,,
14
+ sweatstack-0.31.1.dist-info/METADATA,sha256=GCb3Q6kmp5d74Ap6FFGAeR5o14MfqmcE3773VsEWM3A,775
15
+ sweatstack-0.31.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ sweatstack-0.31.1.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
17
+ sweatstack-0.31.1.dist-info/RECORD,,