sweatstack 0.20.0__tar.gz → 0.22.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.22.0/PKG-INFO +24 -0
- sweatstack-0.22.0/README.md +6 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/pyproject.toml +1 -1
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/client.py +15 -1
- sweatstack-0.20.0/PKG-INFO +0 -116
- sweatstack-0.20.0/README.md +0 -98
- {sweatstack-0.20.0 → sweatstack-0.22.0}/.gitignore +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/.python-version +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/DEVELOPMENT.md +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/Makefile +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/playground/.ipynb_checkpoints/Untitled-checkpoint.ipynb +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/playground/README.md +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/playground/Sweat Stack examples/Getting started.ipynb +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/playground/Untitled.ipynb +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/playground/hello.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/playground/pyproject.toml +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/Sweat Stack examples/Getting started.ipynb +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/__init__.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/cli.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/constants.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/ipython_init.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/jupyterlab_oauth2_startup.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/openapi_schemas.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/py.typed +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/schemas.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/streamlit.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/sweatshell.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/utils.py +0 -0
- {sweatstack-0.20.0 → sweatstack-0.22.0}/uv.lock +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sweatstack
|
|
3
|
+
Version: 0.22.0
|
|
4
|
+
Summary: The official Python client for SweatStack
|
|
5
|
+
Author-email: Aart Goossens <aart@gssns.io>
|
|
6
|
+
Requires-Python: >=3.12
|
|
7
|
+
Requires-Dist: httpx>=0.28.1
|
|
8
|
+
Requires-Dist: pandas>=2.2.3
|
|
9
|
+
Requires-Dist: pyarrow>=19.0.0
|
|
10
|
+
Requires-Dist: pydantic>=2.10.5
|
|
11
|
+
Provides-Extra: jupyter
|
|
12
|
+
Requires-Dist: ipython>=8.31.0; extra == 'jupyter'
|
|
13
|
+
Requires-Dist: jupyterlab>=4.3.4; extra == 'jupyter'
|
|
14
|
+
Requires-Dist: matplotlib>=3.10.0; extra == 'jupyter'
|
|
15
|
+
Provides-Extra: streamlit
|
|
16
|
+
Requires-Dist: streamlit>=1.42.0; extra == 'streamlit'
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# SweatStack Python client library
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
This is the official Python client library for SweatStack.
|
|
23
|
+
|
|
24
|
+
Documentation can be found [here](https://sweatstack.no/python-client-library/).
|
|
@@ -24,7 +24,21 @@ from .schemas import (
|
|
|
24
24
|
from .utils import decode_jwt_body, make_dataframe_streamlit_compatible
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
AUTH_SUCCESSFUL_RESPONSE = "<!DOCTYPE html
|
|
27
|
+
AUTH_SUCCESSFUL_RESPONSE = """<!DOCTYPE html>
|
|
28
|
+
<html>
|
|
29
|
+
<head>
|
|
30
|
+
<style>
|
|
31
|
+
body { max-width: 600px; margin: 40px auto; text-align: center; }
|
|
32
|
+
h1 { color: #2C3E50; font-size: 24px; }
|
|
33
|
+
p { color: #34495E; font-size: 18px; }
|
|
34
|
+
</style>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<img src="https://sweatstack.no/images/sweat-stack-python-client.png" alt="SweatStack Logo" style="width: 200px; margin: 20px auto; display: block;">
|
|
38
|
+
<h1>Successfully authenticated with SweatStack!</h1>
|
|
39
|
+
<p>You have successfully authenticated using the SweatStack Python client library. You can now close this window and return to your Python environment.</p>
|
|
40
|
+
</body>
|
|
41
|
+
</html>"""
|
|
28
42
|
OAUTH2_CLIENT_ID = "5382f68b0d254378"
|
|
29
43
|
|
|
30
44
|
|
sweatstack-0.20.0/PKG-INFO
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sweatstack
|
|
3
|
-
Version: 0.20.0
|
|
4
|
-
Summary: The official Python client for SweatStack
|
|
5
|
-
Author-email: Aart Goossens <aart@gssns.io>
|
|
6
|
-
Requires-Python: >=3.12
|
|
7
|
-
Requires-Dist: httpx>=0.28.1
|
|
8
|
-
Requires-Dist: pandas>=2.2.3
|
|
9
|
-
Requires-Dist: pyarrow>=19.0.0
|
|
10
|
-
Requires-Dist: pydantic>=2.10.5
|
|
11
|
-
Provides-Extra: jupyter
|
|
12
|
-
Requires-Dist: ipython>=8.31.0; extra == 'jupyter'
|
|
13
|
-
Requires-Dist: jupyterlab>=4.3.4; extra == 'jupyter'
|
|
14
|
-
Requires-Dist: matplotlib>=3.10.0; extra == 'jupyter'
|
|
15
|
-
Provides-Extra: streamlit
|
|
16
|
-
Requires-Dist: streamlit>=1.42.0; extra == 'streamlit'
|
|
17
|
-
Description-Content-Type: text/markdown
|
|
18
|
-
|
|
19
|
-
# SweatStack Python client library
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# Quickstart
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
uv pip install sweatstack
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```python
|
|
29
|
-
import sweatstack as ss
|
|
30
|
-
|
|
31
|
-
ss.login()
|
|
32
|
-
|
|
33
|
-
ss.list_activities()
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# Authentication
|
|
38
|
-
|
|
39
|
-
SweatStack supports three authentication methods:
|
|
40
|
-
|
|
41
|
-
### 1. Browser-Based OAuth2 Authentication
|
|
42
|
-
```python
|
|
43
|
-
ss.login() # Opens your default browser for authentication
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### 2. Direct API Key Authentication
|
|
47
|
-
```python
|
|
48
|
-
client = ss.Client(api_key="your-api-key")
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### 3. Environment Variable
|
|
52
|
-
Set the `SWEATSTACK_API_KEY` environment variable:
|
|
53
|
-
```bash
|
|
54
|
-
export SWEATSTACK_API_KEY="your-api-key"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
SweatStack follows this priority order:
|
|
58
|
-
|
|
59
|
-
1. Browser-based OAuth2 (`ss.login()`)
|
|
60
|
-
2. Direct API key via `Client` constructor
|
|
61
|
-
3. `SWEATSTACK_API_KEY` environment variable
|
|
62
|
-
|
|
63
|
-
For example, calling `ss.login()` or `client.login()` will override any existing API key authentication, including those set through the constructor or environment variables.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
## Interfaces: Singleton vs Class-based
|
|
67
|
-
|
|
68
|
-
This library provides both a singleton interface and a class-based interface.
|
|
69
|
-
|
|
70
|
-
Singleton interface:
|
|
71
|
-
```python
|
|
72
|
-
import sweatstack as ss
|
|
73
|
-
|
|
74
|
-
activities = ss.list_activities()
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Class-based interface:
|
|
78
|
-
```python
|
|
79
|
-
from sweatstack import Client
|
|
80
|
-
|
|
81
|
-
client = Client()
|
|
82
|
-
activities = client.list_activities()
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Although both interfaces are feature-equivalent, they serve different purposes:
|
|
86
|
-
- The singleton interface is the default and recommended interface. It is intended for most use cases and is the easiest to use.
|
|
87
|
-
- The class-based interface is intended for more advanced use cases, such as when you need to authenticate multiple users at the same time or in multi-threaded applications.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## Streamlit integration
|
|
91
|
-
|
|
92
|
-
The `sweatstack.streamlit` module provides a Streamlit integration for SweatStack. This requires the optional `streamlit` dependency that can be installed with:
|
|
93
|
-
```
|
|
94
|
-
uv pip install 'sweatstack[streamlit]'
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
The `StreamlitAuth` class is a Streamlit component that handles the OAuth2 authentication flow. It provides a `st.authenticate()` function that can be used to authenticate the user.
|
|
98
|
-
|
|
99
|
-
Example usage:
|
|
100
|
-
|
|
101
|
-
```python
|
|
102
|
-
from sweatstack.streamlit import StreamlitAuth
|
|
103
|
-
|
|
104
|
-
auth = StreamlitAuth()
|
|
105
|
-
|
|
106
|
-
with st.sidebar:
|
|
107
|
-
st.authenticate()
|
|
108
|
-
|
|
109
|
-
if not auth.is_authenticated():
|
|
110
|
-
st.write("User is not authenticated")
|
|
111
|
-
st.stop()
|
|
112
|
-
|
|
113
|
-
st.write("User is authenticated")
|
|
114
|
-
|
|
115
|
-
auth.client.get_latest_activity()
|
|
116
|
-
```
|
sweatstack-0.20.0/README.md
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# SweatStack Python client library
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Quickstart
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
uv pip install sweatstack
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
```python
|
|
11
|
-
import sweatstack as ss
|
|
12
|
-
|
|
13
|
-
ss.login()
|
|
14
|
-
|
|
15
|
-
ss.list_activities()
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Authentication
|
|
20
|
-
|
|
21
|
-
SweatStack supports three authentication methods:
|
|
22
|
-
|
|
23
|
-
### 1. Browser-Based OAuth2 Authentication
|
|
24
|
-
```python
|
|
25
|
-
ss.login() # Opens your default browser for authentication
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 2. Direct API Key Authentication
|
|
29
|
-
```python
|
|
30
|
-
client = ss.Client(api_key="your-api-key")
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### 3. Environment Variable
|
|
34
|
-
Set the `SWEATSTACK_API_KEY` environment variable:
|
|
35
|
-
```bash
|
|
36
|
-
export SWEATSTACK_API_KEY="your-api-key"
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
SweatStack follows this priority order:
|
|
40
|
-
|
|
41
|
-
1. Browser-based OAuth2 (`ss.login()`)
|
|
42
|
-
2. Direct API key via `Client` constructor
|
|
43
|
-
3. `SWEATSTACK_API_KEY` environment variable
|
|
44
|
-
|
|
45
|
-
For example, calling `ss.login()` or `client.login()` will override any existing API key authentication, including those set through the constructor or environment variables.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Interfaces: Singleton vs Class-based
|
|
49
|
-
|
|
50
|
-
This library provides both a singleton interface and a class-based interface.
|
|
51
|
-
|
|
52
|
-
Singleton interface:
|
|
53
|
-
```python
|
|
54
|
-
import sweatstack as ss
|
|
55
|
-
|
|
56
|
-
activities = ss.list_activities()
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Class-based interface:
|
|
60
|
-
```python
|
|
61
|
-
from sweatstack import Client
|
|
62
|
-
|
|
63
|
-
client = Client()
|
|
64
|
-
activities = client.list_activities()
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Although both interfaces are feature-equivalent, they serve different purposes:
|
|
68
|
-
- The singleton interface is the default and recommended interface. It is intended for most use cases and is the easiest to use.
|
|
69
|
-
- The class-based interface is intended for more advanced use cases, such as when you need to authenticate multiple users at the same time or in multi-threaded applications.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Streamlit integration
|
|
73
|
-
|
|
74
|
-
The `sweatstack.streamlit` module provides a Streamlit integration for SweatStack. This requires the optional `streamlit` dependency that can be installed with:
|
|
75
|
-
```
|
|
76
|
-
uv pip install 'sweatstack[streamlit]'
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
The `StreamlitAuth` class is a Streamlit component that handles the OAuth2 authentication flow. It provides a `st.authenticate()` function that can be used to authenticate the user.
|
|
80
|
-
|
|
81
|
-
Example usage:
|
|
82
|
-
|
|
83
|
-
```python
|
|
84
|
-
from sweatstack.streamlit import StreamlitAuth
|
|
85
|
-
|
|
86
|
-
auth = StreamlitAuth()
|
|
87
|
-
|
|
88
|
-
with st.sidebar:
|
|
89
|
-
st.authenticate()
|
|
90
|
-
|
|
91
|
-
if not auth.is_authenticated():
|
|
92
|
-
st.write("User is not authenticated")
|
|
93
|
-
st.stop()
|
|
94
|
-
|
|
95
|
-
st.write("User is authenticated")
|
|
96
|
-
|
|
97
|
-
auth.client.get_latest_activity()
|
|
98
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sweatstack-0.20.0 → sweatstack-0.22.0}/playground/.ipynb_checkpoints/Untitled-checkpoint.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
{sweatstack-0.20.0 → sweatstack-0.22.0}/playground/Sweat Stack examples/Getting started.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sweatstack-0.20.0 → sweatstack-0.22.0}/src/sweatstack/Sweat Stack examples/Getting started.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|