Skip to content

Commit 99d2142

Browse files
author
aman
committed
Update to API 0.14.0 shipped with BodyLoopOS 26.1-stable
1 parent e3c23f7 commit 99d2142

64 files changed

Lines changed: 3032 additions & 463 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,26 @@ The top-level import of the package is the Python module `bodyloop`.
2525
Usage:
2626

2727
```python
28-
import bodyloop
29-
from bodyloop import Viatar, Proband
30-
from bodyloop import ScanUnit
31-
```
28+
from bodyloop_sdk.client import AuthenticatedClient
3229

33-
## Posture Analysis
30+
base_url = "https://bodyloop-control-pc"
31+
api_token = "<YOUR_API_TOKEN_HERE>"
3432

35-
Run a dashboard via:
33+
# Create Auth Client with Access Token
34+
client = AuthenticatedClient(
35+
base_url=base_url,
36+
verify_ssl=False,
37+
token=api_token,
38+
timeout=10.0
39+
)
3640

37-
```bash
38-
uv run python docs/notebooks/05-posture-analysis/01-three-views.py
41+
from functools import partial
42+
from bodyloop_sdk.client.api.probands import get_probands_api_v2_probands_get
43+
44+
get_probands = partial(get_probands_api_v2_probands_get.sync_detailed, client=client)
45+
probands_response = get_probands()
46+
47+
print(probands_response.status_code)
3948
```
4049

4150
## Contribute
@@ -51,6 +60,24 @@ uv run pytest
5160
uv build
5261
```
5362

63+
## Working on both bodyloop-sdk and another project
64+
65+
In the project which depends on the bodyloop-sdk-python, you can install the SDK in editable mode. This allows you to work on both projects simultaneously without needing to publish the SDK to PyPI.
66+
67+
There you do (assumed that the bodyloop-sdk-python is located at `/d/github/bodyloop/bodyloop-sdk-python`):
68+
69+
```bash
70+
uv sync --no-install-project --inexact
71+
72+
uv pip install -e /d/github/bodyloop/bodyloop-sdk-python
73+
74+
uv run --no-sync python some_script.py
75+
```
76+
77+
Mind the `--no-sync` flag in the last command, which prevents the SDK from being reinstalled from PyPi.
78+
79+
## Release Procedure
80+
5481
The release / publish workflow is defined as:
5582

5683
- Push to the `main` branch
@@ -77,7 +104,7 @@ uv run experiments/a_create_client.py
77104
uv run experiments/b_load_probands.py
78105
```
79106

80-
## Release Procedure
107+
### Actions
81108

82109
- Make sure that you are on the `main` branch and that all changes are committed and pushed.
83110
- Create a new tag `vYYYY.MM.DD.r` where `YYYY.MM.DD` is the current date and `r` is the sequential release number we increment over all releases, independent of the date and push the tag as well.

src/bodyloop_sdk/client/api/markers_and_measures/create_angle_api_v2_viatars_viatar_id_angles_post.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ def _get_kwargs(
3535

3636
def _parse_response(
3737
*, client: AuthenticatedClient | Client, response: httpx.Response
38-
) -> Any | HTTPValidationError | None:
38+
) -> Angle | HTTPValidationError | None:
3939
if response.status_code == 201:
40-
response_201 = response.json()
40+
response_201 = Angle.from_dict(response.json())
41+
4142
return response_201
4243

4344
if response.status_code == 422:
@@ -53,7 +54,7 @@ def _parse_response(
5354

5455
def _build_response(
5556
*, client: AuthenticatedClient | Client, response: httpx.Response
56-
) -> Response[Any | HTTPValidationError]:
57+
) -> Response[Angle | HTTPValidationError]:
5758
return Response(
5859
status_code=HTTPStatus(response.status_code),
5960
content=response.content,
@@ -67,7 +68,7 @@ def sync_detailed(
6768
*,
6869
client: AuthenticatedClient,
6970
body: Angle,
70-
) -> Response[Any | HTTPValidationError]:
71+
) -> Response[Angle | HTTPValidationError]:
7172
"""Create Angle
7273
7374
Args:
@@ -82,7 +83,7 @@ def sync_detailed(
8283
httpx.TimeoutException: If the request takes longer than Client.timeout.
8384
8485
Returns:
85-
Response[Any | HTTPValidationError]
86+
Response[Angle | HTTPValidationError]
8687
"""
8788

8889
kwargs = _get_kwargs(
@@ -102,7 +103,7 @@ def sync(
102103
*,
103104
client: AuthenticatedClient,
104105
body: Angle,
105-
) -> Any | HTTPValidationError | None:
106+
) -> Angle | HTTPValidationError | None:
106107
"""Create Angle
107108
108109
Args:
@@ -117,7 +118,7 @@ def sync(
117118
httpx.TimeoutException: If the request takes longer than Client.timeout.
118119
119120
Returns:
120-
Any | HTTPValidationError
121+
Angle | HTTPValidationError
121122
"""
122123

123124
return sync_detailed(
@@ -132,7 +133,7 @@ async def asyncio_detailed(
132133
*,
133134
client: AuthenticatedClient,
134135
body: Angle,
135-
) -> Response[Any | HTTPValidationError]:
136+
) -> Response[Angle | HTTPValidationError]:
136137
"""Create Angle
137138
138139
Args:
@@ -147,7 +148,7 @@ async def asyncio_detailed(
147148
httpx.TimeoutException: If the request takes longer than Client.timeout.
148149
149150
Returns:
150-
Response[Any | HTTPValidationError]
151+
Response[Angle | HTTPValidationError]
151152
"""
152153

153154
kwargs = _get_kwargs(
@@ -165,7 +166,7 @@ async def asyncio(
165166
*,
166167
client: AuthenticatedClient,
167168
body: Angle,
168-
) -> Any | HTTPValidationError | None:
169+
) -> Angle | HTTPValidationError | None:
169170
"""Create Angle
170171
171172
Args:
@@ -180,7 +181,7 @@ async def asyncio(
180181
httpx.TimeoutException: If the request takes longer than Client.timeout.
181182
182183
Returns:
183-
Any | HTTPValidationError
184+
Angle | HTTPValidationError
184185
"""
185186

186187
return (

src/bodyloop_sdk/client/api/markers_and_measures/create_crosssection_api_v2_viatars_viatar_id_crosssections_post.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ def _get_kwargs(
3535

3636
def _parse_response(
3737
*, client: AuthenticatedClient | Client, response: httpx.Response
38-
) -> Any | HTTPValidationError | None:
38+
) -> Crosssection | HTTPValidationError | None:
3939
if response.status_code == 201:
40-
response_201 = response.json()
40+
response_201 = Crosssection.from_dict(response.json())
41+
4142
return response_201
4243

4344
if response.status_code == 422:
@@ -53,7 +54,7 @@ def _parse_response(
5354

5455
def _build_response(
5556
*, client: AuthenticatedClient | Client, response: httpx.Response
56-
) -> Response[Any | HTTPValidationError]:
57+
) -> Response[Crosssection | HTTPValidationError]:
5758
return Response(
5859
status_code=HTTPStatus(response.status_code),
5960
content=response.content,
@@ -67,7 +68,7 @@ def sync_detailed(
6768
*,
6869
client: AuthenticatedClient,
6970
body: Crosssection,
70-
) -> Response[Any | HTTPValidationError]:
71+
) -> Response[Crosssection | HTTPValidationError]:
7172
"""Create Crosssection
7273
7374
Args:
@@ -81,7 +82,7 @@ def sync_detailed(
8182
httpx.TimeoutException: If the request takes longer than Client.timeout.
8283
8384
Returns:
84-
Response[Any | HTTPValidationError]
85+
Response[Crosssection | HTTPValidationError]
8586
"""
8687

8788
kwargs = _get_kwargs(
@@ -101,7 +102,7 @@ def sync(
101102
*,
102103
client: AuthenticatedClient,
103104
body: Crosssection,
104-
) -> Any | HTTPValidationError | None:
105+
) -> Crosssection | HTTPValidationError | None:
105106
"""Create Crosssection
106107
107108
Args:
@@ -115,7 +116,7 @@ def sync(
115116
httpx.TimeoutException: If the request takes longer than Client.timeout.
116117
117118
Returns:
118-
Any | HTTPValidationError
119+
Crosssection | HTTPValidationError
119120
"""
120121

121122
return sync_detailed(
@@ -130,7 +131,7 @@ async def asyncio_detailed(
130131
*,
131132
client: AuthenticatedClient,
132133
body: Crosssection,
133-
) -> Response[Any | HTTPValidationError]:
134+
) -> Response[Crosssection | HTTPValidationError]:
134135
"""Create Crosssection
135136
136137
Args:
@@ -144,7 +145,7 @@ async def asyncio_detailed(
144145
httpx.TimeoutException: If the request takes longer than Client.timeout.
145146
146147
Returns:
147-
Response[Any | HTTPValidationError]
148+
Response[Crosssection | HTTPValidationError]
148149
"""
149150

150151
kwargs = _get_kwargs(
@@ -162,7 +163,7 @@ async def asyncio(
162163
*,
163164
client: AuthenticatedClient,
164165
body: Crosssection,
165-
) -> Any | HTTPValidationError | None:
166+
) -> Crosssection | HTTPValidationError | None:
166167
"""Create Crosssection
167168
168169
Args:
@@ -176,7 +177,7 @@ async def asyncio(
176177
httpx.TimeoutException: If the request takes longer than Client.timeout.
177178
178179
Returns:
179-
Any | HTTPValidationError
180+
Crosssection | HTTPValidationError
180181
"""
181182

182183
return (

src/bodyloop_sdk/client/api/markers_and_measures/create_daxis_api_v2_viatars_viatar_id_axes_post.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ def _get_kwargs(
3535

3636
def _parse_response(
3737
*, client: AuthenticatedClient | Client, response: httpx.Response
38-
) -> Any | HTTPValidationError | None:
38+
) -> Axis | HTTPValidationError | None:
3939
if response.status_code == 201:
40-
response_201 = response.json()
40+
response_201 = Axis.from_dict(response.json())
41+
4142
return response_201
4243

4344
if response.status_code == 422:
@@ -53,7 +54,7 @@ def _parse_response(
5354

5455
def _build_response(
5556
*, client: AuthenticatedClient | Client, response: httpx.Response
56-
) -> Response[Any | HTTPValidationError]:
57+
) -> Response[Axis | HTTPValidationError]:
5758
return Response(
5859
status_code=HTTPStatus(response.status_code),
5960
content=response.content,
@@ -67,7 +68,7 @@ def sync_detailed(
6768
*,
6869
client: AuthenticatedClient,
6970
body: Axis,
70-
) -> Response[Any | HTTPValidationError]:
71+
) -> Response[Axis | HTTPValidationError]:
7172
"""Create Daxis
7273
7374
Args:
@@ -81,7 +82,7 @@ def sync_detailed(
8182
httpx.TimeoutException: If the request takes longer than Client.timeout.
8283
8384
Returns:
84-
Response[Any | HTTPValidationError]
85+
Response[Axis | HTTPValidationError]
8586
"""
8687

8788
kwargs = _get_kwargs(
@@ -101,7 +102,7 @@ def sync(
101102
*,
102103
client: AuthenticatedClient,
103104
body: Axis,
104-
) -> Any | HTTPValidationError | None:
105+
) -> Axis | HTTPValidationError | None:
105106
"""Create Daxis
106107
107108
Args:
@@ -115,7 +116,7 @@ def sync(
115116
httpx.TimeoutException: If the request takes longer than Client.timeout.
116117
117118
Returns:
118-
Any | HTTPValidationError
119+
Axis | HTTPValidationError
119120
"""
120121

121122
return sync_detailed(
@@ -130,7 +131,7 @@ async def asyncio_detailed(
130131
*,
131132
client: AuthenticatedClient,
132133
body: Axis,
133-
) -> Response[Any | HTTPValidationError]:
134+
) -> Response[Axis | HTTPValidationError]:
134135
"""Create Daxis
135136
136137
Args:
@@ -144,7 +145,7 @@ async def asyncio_detailed(
144145
httpx.TimeoutException: If the request takes longer than Client.timeout.
145146
146147
Returns:
147-
Response[Any | HTTPValidationError]
148+
Response[Axis | HTTPValidationError]
148149
"""
149150

150151
kwargs = _get_kwargs(
@@ -162,7 +163,7 @@ async def asyncio(
162163
*,
163164
client: AuthenticatedClient,
164165
body: Axis,
165-
) -> Any | HTTPValidationError | None:
166+
) -> Axis | HTTPValidationError | None:
166167
"""Create Daxis
167168
168169
Args:
@@ -176,7 +177,7 @@ async def asyncio(
176177
httpx.TimeoutException: If the request takes longer than Client.timeout.
177178
178179
Returns:
179-
Any | HTTPValidationError
180+
Axis | HTTPValidationError
180181
"""
181182

182183
return (

0 commit comments

Comments
 (0)