Python client and import tools for the BioModelle API
Project description
Biomodels Client
Python tools for importing wearable sensor data and interacting with the Biomodels API.
The package provides utilities for importing, querying and analysing sensor data, preparing API payloads, and submitting requests to the BioModelle API.
https://biomodels.tkimhofer.dev/swagger
Features
- Import Apple Health exports (
"export.xml"or.zip) - Query and explore sensor data using pandas and SQL
- Prepare API payloads directly from sensor measurements
- Submit requests to the BioModelle API
Installation
pip install biomodels-client
Quick Start
Apple Health Export
Open the Health app on iPhone, tap the profile picture, select Export All Health Data.
The generated ZIP archive contains an export.xml file that can be imported by biomodels-client.
1. Import Apple Health data
The importer accepts both export.xml files and Apple Health ZIP exports.
from biomodels_client.database import SensorStore
from biomodels_client.importers.apple_health import AppleHealthImporter
db = SensorStore("wearables.sqlite")
AppleHealthImporter(
"/path/to/apple_health_export/export.xml"
).write_to(db)
2. Explore sensor data
from biomodels_client.database import SensorStore
db = SensorStore("wearables.sqlite")
sources = db.query("""
SELECT
source_name,
COUNT(*) AS n,
MIN(time_start) AS date_min,
MAX(time_end) AS date_max
FROM measurements
GROUP BY source_name
ORDER BY n DESC
""")
print(sources)
3. Calculate TRIMP from wearable data
from biomodels_client.client import BioModelleClient
from biomodels_client.database import SensorStore
db = SensorStore("wearables.sqlite")
hr_ruhe = db.estimate_hr_rest(months=12)
hr_max = db.estimate_hr_max(months=24)
payload = db.trimp_payload(
start="2026-06-17 06:00",
end="2026-06-18 23:00",
)
client = BioModelleClient()
result = client.trimp(
**payload,
geschlecht="m",
hr_ruhe=hr_ruhe,
hr_max=hr_max,
)
print(result)
Example Scripts
Wearable Sensor Workflow
examples/
└── wearable_to_trimp/
├── 01_import_apple_health.py
├── 02_inspect_sensor_store.py
├── 03_sensor_to_trimp.py
└── 04_submit_trimp.py
API Reference
examples/
└── api_reference/
└── all_endpoints.py
SensorStore
The SensorStore class provides:
db.select_heart_rate(...)
db.select_best_heart_rate_source(...)
db.estimate_hr_rest(...)
db.estimate_hr_max(...)
db.trimp_payload(...)
db.query(...)
db.execute(...)
for exploration and preparation of wearable sensor data.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file biomodels_client-0.1.2.tar.gz.
File metadata
- Download URL: biomodels_client-0.1.2.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b55ecb8001b1f90b91f968f27c5bffcb1e7976ddcf0b5656d73b47a89d49929
|
|
| MD5 |
6e915cfddadcfb0282ee3b47c1527f11
|
|
| BLAKE2b-256 |
4ee291e222b28ae2a02bc138323eb80ebddd8585fd67884fdd40921004d99363
|
Provenance
The following attestation bundles were made for biomodels_client-0.1.2.tar.gz:
Publisher:
python-publish.yml on tkimhofer/biomodels-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biomodels_client-0.1.2.tar.gz -
Subject digest:
5b55ecb8001b1f90b91f968f27c5bffcb1e7976ddcf0b5656d73b47a89d49929 - Sigstore transparency entry: 1911337311
- Sigstore integration time:
-
Permalink:
tkimhofer/biomodels-client@eb2352089ee4c8ee019d5e762edb3bad73662afe -
Branch / Tag:
refs/tags/v0.1.2r - Owner: https://github.com/tkimhofer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@eb2352089ee4c8ee019d5e762edb3bad73662afe -
Trigger Event:
release
-
Statement type:
File details
Details for the file biomodels_client-0.1.2-py3-none-any.whl.
File metadata
- Download URL: biomodels_client-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f0090622416fabea256c4fa101c9853bc4591d198d26b2ca898c2543bbb14ed
|
|
| MD5 |
e564ca2956cbfc7f72d47b55ccb54fb0
|
|
| BLAKE2b-256 |
1f806bc65393d60b70b9ea58f3d5cae3c4f7e99deac7274da7fc554cb9a68b94
|
Provenance
The following attestation bundles were made for biomodels_client-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on tkimhofer/biomodels-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biomodels_client-0.1.2-py3-none-any.whl -
Subject digest:
5f0090622416fabea256c4fa101c9853bc4591d198d26b2ca898c2543bbb14ed - Sigstore transparency entry: 1911337411
- Sigstore integration time:
-
Permalink:
tkimhofer/biomodels-client@eb2352089ee4c8ee019d5e762edb3bad73662afe -
Branch / Tag:
refs/tags/v0.1.2r - Owner: https://github.com/tkimhofer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@eb2352089ee4c8ee019d5e762edb3bad73662afe -
Trigger Event:
release
-
Statement type: