sweatstack 0.53.0__tar.gz → 0.55.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.
- {sweatstack-0.53.0 → sweatstack-0.55.0}/.claude/settings.local.json +3 -2
- {sweatstack-0.53.0 → sweatstack-0.55.0}/.gitignore +3 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/CHANGELOG.md +18 -0
- sweatstack-0.55.0/Makefile +12 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/PKG-INFO +1 -1
- sweatstack-0.55.0/docs/conf.py +26 -0
- sweatstack-0.55.0/docs/everything.rst +171 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/pyproject.toml +5 -1
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/client.py +315 -46
- sweatstack-0.55.0/src/sweatstack/py.typed +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/schemas.py +37 -14
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/streamlit.py +104 -5
- {sweatstack-0.53.0 → sweatstack-0.55.0}/uv.lock +196 -7
- sweatstack-0.53.0/Makefile +0 -6
- {sweatstack-0.53.0 → sweatstack-0.55.0}/.python-version +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/DEVELOPMENT.md +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/README.md +0 -0
- /sweatstack-0.53.0/playground/README.md → /sweatstack-0.55.0/docs/index.rst +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/playground/.ipynb_checkpoints/Untitled-checkpoint.ipynb +0 -0
- /sweatstack-0.53.0/src/sweatstack/py.typed → /sweatstack-0.55.0/playground/README.md +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/playground/Sweat Stack examples/Getting started.ipynb +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/playground/Untitled.ipynb +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/playground/hello.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/playground/pyproject.toml +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/Sweat Stack examples/Getting started.ipynb +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/__init__.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/cli.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/constants.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/ipython_init.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/jupyterlab_oauth2_startup.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/openapi_schemas.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/sweatshell.py +0 -0
- {sweatstack-0.53.0 → sweatstack-0.55.0}/src/sweatstack/utils.py +0 -0
|
@@ -6,6 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## [0.55.0] - 2025-10-24
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Added a new `get_activity_awd()` method to the `ss.Client` class that allows for getting the accumulated work duration (AWD) data for a specific activity.
|
|
13
|
+
- Added a new `get_longitudinal_awd()` method to the `ss.Client` class that allows for getting the AWD data for a specific date range.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [0.54.0] - 2025-09-11
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Added new methods `get_authorization_url()`, `exchange_code_for_token()` and `get_pkce_params()` to the `ss.Client` class that allow for getting the authorization URL and exchanging a code for tokens. This should make it easier for clients to implement the SweatStack OAuth2 flow.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fixed an issue where the `ss.get_activities()` with `as_dataframe=True` method would raise an error if no activities were found.
|
|
25
|
+
|
|
26
|
+
|
|
9
27
|
## [0.53.0] - 2025-09-11
|
|
10
28
|
|
|
11
29
|
### Added
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
# So autodoc can import your package
|
|
5
|
+
sys.path.insert(0, os.path.abspath("..")) # adjust if needed
|
|
6
|
+
|
|
7
|
+
extensions = [
|
|
8
|
+
"sphinx.ext.autodoc",
|
|
9
|
+
"sphinx.ext.autosummary",
|
|
10
|
+
"sphinx.ext.napoleon", # if you use Google/NumPy docstrings
|
|
11
|
+
"sphinx_markdown_builder", # <-- this is the important one
|
|
12
|
+
"myst_parser", # optional, for .md sources
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
autosummary_generate = True
|
|
16
|
+
|
|
17
|
+
# Autodoc configuration
|
|
18
|
+
autodoc_default_options = {
|
|
19
|
+
'private-members': False, # Don't document private members (starting with _)
|
|
20
|
+
'special-members': False, # Don't document special members (like __init__ unless specified)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Optional nice-to-haves for markdown builder:
|
|
24
|
+
markdown_anchor_sections = True # add anchors to each section/function/class
|
|
25
|
+
markdown_anchor_signatures = True # add anchors to signatures
|
|
26
|
+
markdown_bullet = "*"
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Complete API Reference
|
|
2
|
+
======================
|
|
3
|
+
|
|
4
|
+
Environment Variables
|
|
5
|
+
=====================
|
|
6
|
+
|
|
7
|
+
The SweatStack client library uses environment variables for configuration.
|
|
8
|
+
These variables provide defaults for authentication, caching, and Streamlit integration.
|
|
9
|
+
|
|
10
|
+
Authentication
|
|
11
|
+
--------------
|
|
12
|
+
|
|
13
|
+
.. envvar:: SWEATSTACK_API_KEY
|
|
14
|
+
|
|
15
|
+
API access token for authenticating with SweatStack.
|
|
16
|
+
|
|
17
|
+
Automatically loaded by the Client if not provided during initialization.
|
|
18
|
+
Falls back to persistent storage if not found in environment.
|
|
19
|
+
|
|
20
|
+
Example::
|
|
21
|
+
|
|
22
|
+
export SWEATSTACK_API_KEY="your_token_here"
|
|
23
|
+
|
|
24
|
+
.. envvar:: SWEATSTACK_REFRESH_TOKEN
|
|
25
|
+
|
|
26
|
+
Refresh token used for automatic token renewal.
|
|
27
|
+
|
|
28
|
+
Loaded from environment, instance, or persistent storage. Used by the Client
|
|
29
|
+
to automatically refresh expired access tokens.
|
|
30
|
+
|
|
31
|
+
.. envvar:: SWEATSTACK_URL
|
|
32
|
+
|
|
33
|
+
Custom SweatStack instance URL.
|
|
34
|
+
|
|
35
|
+
Override the default SweatStack API URL. Useful for testing or
|
|
36
|
+
connecting to self-hosted instances.
|
|
37
|
+
|
|
38
|
+
Default: ``https://app.sweatstack.no``
|
|
39
|
+
|
|
40
|
+
Caching
|
|
41
|
+
-------
|
|
42
|
+
|
|
43
|
+
.. envvar:: SWEATSTACK_LOCAL_CACHE
|
|
44
|
+
|
|
45
|
+
Enable local filesystem caching of API responses.
|
|
46
|
+
|
|
47
|
+
Set to any truthy value (``1``, ``true``, ``yes``) to enable caching
|
|
48
|
+
of longitudinal data requests. Cached data persists across sessions.
|
|
49
|
+
Use ``client.clear_cache()`` to remove cached data.
|
|
50
|
+
|
|
51
|
+
Default: Disabled
|
|
52
|
+
|
|
53
|
+
Example::
|
|
54
|
+
|
|
55
|
+
export SWEATSTACK_LOCAL_CACHE=1
|
|
56
|
+
|
|
57
|
+
.. envvar:: SWEATSTACK_CACHE_DIR
|
|
58
|
+
|
|
59
|
+
Custom directory location for cached data.
|
|
60
|
+
|
|
61
|
+
Specify where to store cached API responses. If not set, defaults to
|
|
62
|
+
the system temp directory with a ``sweatstack/{user_id}`` subdirectory.
|
|
63
|
+
|
|
64
|
+
Default: System temp directory (e.g., ``/tmp/sweatstack/{user_id}``)
|
|
65
|
+
|
|
66
|
+
Example::
|
|
67
|
+
|
|
68
|
+
export SWEATSTACK_CACHE_DIR=/path/to/cache
|
|
69
|
+
|
|
70
|
+
Streamlit OAuth2
|
|
71
|
+
----------------
|
|
72
|
+
|
|
73
|
+
These environment variables are used by :class:`sweatstack.streamlit.StreamlitAuth`
|
|
74
|
+
for OAuth2 authentication in Streamlit applications.
|
|
75
|
+
|
|
76
|
+
.. envvar:: SWEATSTACK_CLIENT_ID
|
|
77
|
+
|
|
78
|
+
OAuth2 application client ID.
|
|
79
|
+
|
|
80
|
+
The client ID from your registered SweatStack OAuth2 application.
|
|
81
|
+
Required for Streamlit authentication if not provided to StreamlitAuth.
|
|
82
|
+
|
|
83
|
+
.. envvar:: SWEATSTACK_CLIENT_SECRET
|
|
84
|
+
|
|
85
|
+
OAuth2 application client secret.
|
|
86
|
+
|
|
87
|
+
The client secret from your registered SweatStack OAuth2 application.
|
|
88
|
+
Required for Streamlit authentication if not provided to StreamlitAuth.
|
|
89
|
+
|
|
90
|
+
.. envvar:: SWEATSTACK_SCOPES
|
|
91
|
+
|
|
92
|
+
Comma-separated list of OAuth2 scopes.
|
|
93
|
+
|
|
94
|
+
Specify which permissions to request during OAuth2 authorization.
|
|
95
|
+
|
|
96
|
+
Default: ``data:read,profile``
|
|
97
|
+
|
|
98
|
+
Example::
|
|
99
|
+
|
|
100
|
+
export SWEATSTACK_SCOPES="data:read,data:write,profile"
|
|
101
|
+
|
|
102
|
+
.. envvar:: SWEATSTACK_REDIRECT_URI
|
|
103
|
+
|
|
104
|
+
OAuth2 redirect URI.
|
|
105
|
+
|
|
106
|
+
The URI where users are redirected after OAuth2 authorization.
|
|
107
|
+
Must match a redirect URI registered in your OAuth2 application.
|
|
108
|
+
|
|
109
|
+
Example::
|
|
110
|
+
|
|
111
|
+
export SWEATSTACK_REDIRECT_URI="http://localhost:8501"
|
|
112
|
+
|
|
113
|
+
Modules
|
|
114
|
+
=======
|
|
115
|
+
|
|
116
|
+
sweatstack
|
|
117
|
+
----------
|
|
118
|
+
|
|
119
|
+
.. automodule:: sweatstack
|
|
120
|
+
:members:
|
|
121
|
+
:undoc-members:
|
|
122
|
+
:show-inheritance:
|
|
123
|
+
|
|
124
|
+
sweatstack.client
|
|
125
|
+
-----------------
|
|
126
|
+
|
|
127
|
+
.. automodule:: sweatstack.client
|
|
128
|
+
:members:
|
|
129
|
+
:undoc-members:
|
|
130
|
+
:inherited-members:
|
|
131
|
+
:show-inheritance:
|
|
132
|
+
:exclude-members: _LocalCacheMixin, _TokenStorageMixin, _OAuth2Mixin, _DelegationMixin
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
sweatstack.streamlit
|
|
136
|
+
--------------------
|
|
137
|
+
|
|
138
|
+
.. automodule:: sweatstack.streamlit
|
|
139
|
+
:members:
|
|
140
|
+
:undoc-members:
|
|
141
|
+
:show-inheritance:
|
|
142
|
+
|
|
143
|
+
sweatstack.schemas
|
|
144
|
+
------------------
|
|
145
|
+
|
|
146
|
+
.. automodule:: sweatstack.schemas
|
|
147
|
+
:members:
|
|
148
|
+
:undoc-members:
|
|
149
|
+
:show-inheritance:
|
|
150
|
+
|
|
151
|
+
Sport
|
|
152
|
+
~~~~~
|
|
153
|
+
|
|
154
|
+
.. autoclass:: sweatstack.schemas.Sport
|
|
155
|
+
:members: root_sport, parent_sport, is_sub_sport_of, is_root_sport, display_name
|
|
156
|
+
:undoc-members:
|
|
157
|
+
|
|
158
|
+
Metric
|
|
159
|
+
~~~~~~
|
|
160
|
+
|
|
161
|
+
.. autoclass:: sweatstack.schemas.Metric
|
|
162
|
+
:members: display_name
|
|
163
|
+
:undoc-members:
|
|
164
|
+
|
|
165
|
+
sweatstack.openapi_schemas
|
|
166
|
+
------------------
|
|
167
|
+
|
|
168
|
+
.. automodule:: sweatstack.openapi_schemas
|
|
169
|
+
:members:
|
|
170
|
+
:undoc-members:
|
|
171
|
+
:show-inheritance:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sweatstack"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.55.0"
|
|
4
4
|
description = "The official Python client for SweatStack"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -33,6 +33,10 @@ build-backend = "hatchling.build"
|
|
|
33
33
|
[dependency-groups]
|
|
34
34
|
dev = [
|
|
35
35
|
"datamodel-code-generator>=0.26.5",
|
|
36
|
+
"myst-parser>=4.0.1",
|
|
37
|
+
"sphinx>=8.2.3",
|
|
38
|
+
"sphinx-markdown-builder>=0.6.8",
|
|
39
|
+
"streamlit>=1.42.0",
|
|
36
40
|
]
|
|
37
41
|
|
|
38
42
|
[tool.uv.workspace]
|