sweatstack 0.11.1__py3-none-any.whl → 0.12.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/cli.py +2 -2
- sweatstack/client.py +461 -441
- sweatstack/jupyterlab_oauth2_startup.py +5 -0
- sweatstack/openapi_schemas.py +368 -0
- sweatstack/py.typed +0 -0
- sweatstack/schemas.py +3 -229
- sweatstack/utils.py +13 -0
- sweatstack-0.12.0.dist-info/METADATA +85 -0
- sweatstack-0.12.0.dist-info/RECORD +14 -0
- {sweatstack-0.11.1.dist-info → sweatstack-0.12.0.dist-info}/WHEEL +1 -1
- sweatstack/Sweat Stack examples/Getting started.ipynb +0 -28784
- sweatstack/plotting.py +0 -251
- sweatstack-0.11.1.dist-info/METADATA +0 -359
- sweatstack-0.11.1.dist-info/RECORD +0 -13
- {sweatstack-0.11.1.dist-info → sweatstack-0.12.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sweatstack
|
|
3
|
+
Version: 0.12.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: jupyterlab
|
|
12
|
+
Requires-Dist: ipython>=8.31.0; extra == 'jupyterlab'
|
|
13
|
+
Requires-Dist: jupyterlab>=4.3.4; extra == 'jupyterlab'
|
|
14
|
+
Requires-Dist: matplotlib; extra == 'jupyterlab'
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# SweatStack Python client library
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# Quickstart
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
uv pip install sweatstack
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
import sweatstack as ss
|
|
28
|
+
|
|
29
|
+
ss.login()
|
|
30
|
+
|
|
31
|
+
ss.list_activities()
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# Authentication
|
|
36
|
+
|
|
37
|
+
SweatStack supports three authentication methods:
|
|
38
|
+
|
|
39
|
+
### 1. Browser-Based OAuth2 Authentication
|
|
40
|
+
```python
|
|
41
|
+
ss.login() # Opens your default browser for authentication
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Direct API Key Authentication
|
|
45
|
+
```python
|
|
46
|
+
client = ss.Client(api_key="your-api-key")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. Environment Variable
|
|
50
|
+
Set the `SWEATSTACK_API_KEY` environment variable:
|
|
51
|
+
```bash
|
|
52
|
+
export SWEATSTACK_API_KEY="your-api-key"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
SweatStack follows this priority order:
|
|
56
|
+
|
|
57
|
+
1. Browser-based OAuth2 (`ss.login()`)
|
|
58
|
+
2. Direct API key via `Client` constructor
|
|
59
|
+
3. `SWEATSTACK_API_KEY` environment variable
|
|
60
|
+
|
|
61
|
+
For example, calling `ss.login()` or `client.login()` will override any existing API key authentication, including those set through the constructor or environment variables.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Interfaces: Singleton vs Class-based
|
|
65
|
+
|
|
66
|
+
This library provides both a singleton interface and a class-based interface.
|
|
67
|
+
|
|
68
|
+
Singleton interface:
|
|
69
|
+
```python
|
|
70
|
+
import sweatstack as ss
|
|
71
|
+
|
|
72
|
+
activities = ss.list_activities()
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Class-based interface:
|
|
76
|
+
```python
|
|
77
|
+
from sweatstack import Client
|
|
78
|
+
|
|
79
|
+
client = Client()
|
|
80
|
+
activities = client.list_activities()
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Although both interfaces are feature-equivalent, they serve different purposes:
|
|
84
|
+
- The singleton interface is the default and recommended interface. It is intended for most use cases and is the easiest to use.
|
|
85
|
+
- 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.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
sweatstack/__init__.py,sha256=tiVfgKlswRPaDMEy0gA7u8rveqEYZTA_kyB9lJ3J6Sc,21
|
|
2
|
+
sweatstack/cli.py,sha256=N1NWOgEZR2yaJvIXxo9qvp_jFlypZYb0nujpbVNYQ6A,720
|
|
3
|
+
sweatstack/client.py,sha256=-dE1t55kJkmo8QCUNeftHu-5FT_hOh9k4azQUq8gL6c,19131
|
|
4
|
+
sweatstack/ipython_init.py,sha256=zBGUlMFkdpLvsNpOpwrNaKRUpUZhzaICvH8ODJgMPcI,229
|
|
5
|
+
sweatstack/jupyterlab_oauth2_startup.py,sha256=eZ6xi0Sa4hO4vUanimq0SqjduHtiywCURSDNWk_I-7s,1200
|
|
6
|
+
sweatstack/openapi_schemas.py,sha256=vtYHa6A0kADFbd_jK1O7Kbn8YkbPfzaIwsRDDYjYeSA,13038
|
|
7
|
+
sweatstack/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
sweatstack/schemas.py,sha256=CdkeV6IRmIuvxae7C5dz-hVlb6hkzEYfqKHHgVJprmY,90
|
|
9
|
+
sweatstack/sweatshell.py,sha256=MYLNcWbOdceqKJ3S0Pe8dwHXEeYsGJNjQoYUXpMTftA,333
|
|
10
|
+
sweatstack/utils.py,sha256=0DcvHV1EOHQnN5OlfYo2DRrw8a9-6YkxTjLVCfi5ylE,277
|
|
11
|
+
sweatstack-0.12.0.dist-info/METADATA,sha256=Y5-IDBEV8SgHd8uuDQgIBUzo0t9I0o2FpoFuZDEOFEs,2165
|
|
12
|
+
sweatstack-0.12.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
13
|
+
sweatstack-0.12.0.dist-info/entry_points.txt,sha256=kCzOUQI3dqbTpEYqtgYDeiKFaqaA7BMlV6D24BMzCFU,208
|
|
14
|
+
sweatstack-0.12.0.dist-info/RECORD,,
|