sweatstack 0.51.0__py3-none-any.whl → 0.53.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
@@ -259,7 +259,7 @@ class OAuth2Mixin:
259
259
  "client_id": OAUTH2_CLIENT_ID,
260
260
  "redirect_uri": redirect_uri,
261
261
  "code_challenge": code_challenge,
262
- "scope": "data:read profile",
262
+ "scope": "data:read data:write profile",
263
263
  "prompt": "none",
264
264
  }
265
265
  base_url = self.url
@@ -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):
@@ -1212,6 +1212,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
1212
1212
  speed: float | None = None,
1213
1213
  heart_rate: int | None = None,
1214
1214
  tags: list[str] | None = None,
1215
+ sport: Sport | str | None = None,
1215
1216
  ) -> TraceDetails:
1216
1217
  """Creates a new trace with the specified parameters.
1217
1218
 
@@ -1227,6 +1228,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
1227
1228
  speed: Optional speed measurement in meters per second.
1228
1229
  heart_rate: Optional heart rate measurement in beats per minute.
1229
1230
  tags: Optional list of tags to associate with this trace.
1231
+ sport: Optional sport to associate with this trace.
1230
1232
 
1231
1233
  Returns:
1232
1234
  TraceDetails: The created trace object with all details.
@@ -1234,6 +1236,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
1234
1236
  Raises:
1235
1237
  HTTPStatusError: If the API request fails.
1236
1238
  """
1239
+ sport = self._enums_to_strings([sport])[0] if sport else None
1237
1240
  with self._http_client() as client:
1238
1241
  response = client.post(
1239
1242
  url="/api/v1/traces/",
@@ -1246,6 +1249,7 @@ class Client(OAuth2Mixin, DelegationMixin, TokenStorageMixin, LocalCacheMixin):
1246
1249
  "speed": speed,
1247
1250
  "heart_rate": heart_rate,
1248
1251
  "tags": tags,
1252
+ "sport": sport,
1249
1253
  },
1250
1254
  )
1251
1255
  self._raise_for_status(response)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sweatstack
3
- Version: 0.51.0
3
+ Version: 0.53.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
  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=GnrfUog9yhRjmYFdTRyw99vRp_ylwWWF5kETS8dwGUc,54920
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
@@ -11,7 +11,7 @@ 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.51.0.dist-info/METADATA,sha256=U-4-d4783k-LzTB5mVElBiIp1atrxWJpey3RqX8_lvA,852
15
- sweatstack-0.51.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- sweatstack-0.51.0.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
17
- sweatstack-0.51.0.dist-info/RECORD,,
14
+ sweatstack-0.53.0.dist-info/METADATA,sha256=cd5PudK07XBW9u4lRosHfuTwbg7IBQ9APSr6H_CSfTg,852
15
+ sweatstack-0.53.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ sweatstack-0.53.0.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
17
+ sweatstack-0.53.0.dist-info/RECORD,,