Skip to main content

BodyLoop SDK for Python

Python SDK for the BodyLoop API for seamless ecosystem integration

The URL of the source repository https://github.com/bodyloop/bodyloop-sdk-python has suffix python to enable adding SDKs for other lanuages such as JavaScript/TypeScript, C/C++, Rust, etc.

The distribution name (install) of the Python Package name is bodyloop-sdk and is available in the global Package Index PyPi at https://pypi.org/project/bodyloop-sdk. It omits the suffix since PyPi already tells us that we are in the Python ecosystem.

Examples how to get the package are:

pip install bodyloop-sdk

poetry add bodyloop-sdk

uv add bodyloop-sdk

pipx install bodyloop-sdk

uv tool install bodyloop-sdk

The top-level import of the package is the Python module bodyloop.

Usage:

from bodyloop_sdk.client import AuthenticatedClient

base_url = "https://bodyloop-control-pc"
api_token = "<YOUR_API_TOKEN_HERE>"

# Create Auth Client with Access Token
client = AuthenticatedClient(
    base_url=base_url,
    verify_ssl=False,
    token=api_token,
    timeout=10.0
)

from functools import partial
from bodyloop_sdk.client.api.probands import get_probands_api_v2_probands_get

get_probands = partial(get_probands_api_v2_probands_get.sync_detailed, client=client)
probands_response = get_probands()

print(probands_response.status_code)

Contribute

Local workflow

git clone git@github.com:BodyLoop/bodyloop-sdk-python.git
cd bodyloop-sdk-python

uv sync
uv run pytest
uv build

Working on both bodyloop-sdk and another project

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.

There you do (assumed that the bodyloop-sdk-python is located at /d/github/bodyloop/bodyloop-sdk-python):

uv sync --no-install-project  --inexact

uv pip install -e /d/github/bodyloop/bodyloop-sdk-python

uv run --no-sync python some_script.py

Mind the --no-sync flag in the last command, which prevents the SDK from being reinstalled from PyPi.

Release Procedure

The release / publish workflow is defined as:

  • Push to the main branch
  • 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.
  • Create a new GitHub release based on that tag, baptize the release identical to the tag and add release notes.
  • Triggered by the release creation the GitHub Action publish.yml will build the package and publish it to PyPi.

Update the API client

The API generator https://pypi.org/project/openapi-python-client/ is used.

./generate_api_client.sh <ip_or_hostname_of_my_bodyloop_instance>

Use the experiments to get your feet wet:

touch .env
echo "BODYLOOP_BASE_URL='https://bodyloop-control-pc'" >> .env
echo "BODYLOOP_API_TOKEN='your_api_token_here'" >> .env

uv run experiments/a_create_client.py
uv run experiments/b_load_probands.py

Actions

  • Make sure that you are on the main branch and that all changes are committed and pushed.
  • 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.
git checkout main
git pull origin main

git tag | tail -1

git tag v2026.04.13.2
git push --tags
  • Create a new GitHub release based on that tag, baptize the release identical to the tag and add release notes. You can use the web frontend or the GitHub CLI:
version=$(git tag | tail -1)

gh release create $version --title $version --notes "Release notes here"

Double-check that ...

License

See LICENSE

Metadata

Release files for bodyloop-sdk 2026.10.15.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bodyloop-sdk 2026.10.15.7
File Size Uploaded Provenance Actions
bodyloop_sdk-2026.10.15.7.tar.gz 180.8 kB With provenance Details for bodyloop_sdk-2026.10.15.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bodyloop-sdk 2026.10.15.7
File Interpreter ABI Platform Actions
bodyloop_sdk-2026.10.15.7-py3-none-any.whl Python 3 none any Details for bodyloop_sdk-2026.10.15.7-py3-none-any.whl

Total release size: 579.4 kB

Release files / bodyloop_sdk-2026.10.15.7.tar.gz

Download URL bodyloop_sdk-2026.10.15.7.tar.gz
Size 180.8 kB
Tags Source
SHA-256 checksum
How to use checksums
713eef6d380c919488bc35229b5d942ecc0c8000da379b0a1f4f38355833f05f
BLAKE2b-256 checksum
How to use checksums
b61701efec12eebf22cbc916ca3aa67b24a750fa587ba8ce9481ebd4c6ed73cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / bodyloop_sdk-2026.10.15.7-py3-none-any.whl

Download URL bodyloop_sdk-2026.10.15.7-py3-none-any.whl
Size 398.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b9b20c351a926424078ec799abf3dd40459713401ce869b8c9ee4c3b98e5aa5
BLAKE2b-256 checksum
How to use checksums
92d5c2e63ec28b155012d866795f01334518de9bd1d63856c8e5a3e389b736ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Security for bodyloop-sdk 2026.10.15.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bodyloop_sdk-2026.10.15.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page