sweatstack 0.30.0__tar.gz → 0.31.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.30.0 → sweatstack-0.31.0}/PKG-INFO +1 -1
  2. {sweatstack-0.30.0 → sweatstack-0.31.0}/pyproject.toml +1 -1
  3. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/client.py +11 -1
  4. {sweatstack-0.30.0 → sweatstack-0.31.0}/.gitignore +0 -0
  5. {sweatstack-0.30.0 → sweatstack-0.31.0}/.python-version +0 -0
  6. {sweatstack-0.30.0 → sweatstack-0.31.0}/DEVELOPMENT.md +0 -0
  7. {sweatstack-0.30.0 → sweatstack-0.31.0}/Makefile +0 -0
  8. {sweatstack-0.30.0 → sweatstack-0.31.0}/README.md +0 -0
  9. {sweatstack-0.30.0 → sweatstack-0.31.0}/playground/.ipynb_checkpoints/Untitled-checkpoint.ipynb +0 -0
  10. {sweatstack-0.30.0 → sweatstack-0.31.0}/playground/README.md +0 -0
  11. {sweatstack-0.30.0 → sweatstack-0.31.0}/playground/Sweat Stack examples/Getting started.ipynb +0 -0
  12. {sweatstack-0.30.0 → sweatstack-0.31.0}/playground/Untitled.ipynb +0 -0
  13. {sweatstack-0.30.0 → sweatstack-0.31.0}/playground/hello.py +0 -0
  14. {sweatstack-0.30.0 → sweatstack-0.31.0}/playground/pyproject.toml +0 -0
  15. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/Sweat Stack examples/Getting started.ipynb +0 -0
  16. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/__init__.py +0 -0
  17. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/cli.py +0 -0
  18. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/constants.py +0 -0
  19. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/ipython_init.py +0 -0
  20. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/jupyterlab_oauth2_startup.py +0 -0
  21. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/openapi_schemas.py +0 -0
  22. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/py.typed +0 -0
  23. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/schemas.py +0 -0
  24. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/streamlit.py +0 -0
  25. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/sweatshell.py +0 -0
  26. {sweatstack-0.30.0 → sweatstack-0.31.0}/src/sweatstack/utils.py +0 -0
  27. {sweatstack-0.30.0 → sweatstack-0.31.0}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sweatstack
3
- Version: 0.30.0
3
+ Version: 0.31.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.30.0"
3
+ version = "0.31.0"
4
4
  description = "The official Python client for SweatStack"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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("python-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
 
@@ -517,6 +526,7 @@ class Client(OAuth2Mixin, DelegationMixin):
517
526
  if end is not None:
518
527
  params["end"] = end.isoformat()
519
528
  if sports is not None:
529
+ sports = [sport.value if isinstance(sport, Sport) else sport for sport in sports]
520
530
  params["sports"] = sports
521
531
  if tags is not None:
522
532
  params["tags"] = tags
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes