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.
Metadata
Release files for biomodels-client 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| biomodels_client-0.1.2.tar.gz | 9.0 kB | With provenance | Details for biomodels_client-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| biomodels_client-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for biomodels_client-0.1.2-py3-none-any.whl |
Total release size: 20.2 kB
Release files / biomodels_client-0.1.2.tar.gz
| Download URL | biomodels_client-0.1.2.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b55ecb8001b1f90b91f968f27c5bffcb1e7976ddcf0b5656d73b47a89d49929
|
|
BLAKE2b-256 checksum How to use checksums |
4ee291e222b28ae2a02bc138323eb80ebddd8585fd67884fdd40921004d99363
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 22, 2026.
Transparency logRelease files / biomodels_client-0.1.2-py3-none-any.whl
| Download URL | biomodels_client-0.1.2-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f0090622416fabea256c4fa101c9853bc4591d198d26b2ca898c2543bbb14ed
|
|
BLAKE2b-256 checksum How to use checksums |
1f806bc65393d60b70b9ea58f3d5cae3c4f7e99deac7274da7fc554cb9a68b94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 22, 2026.
Transparency logSecurity for biomodels-client 0.1.2
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.
Attestation for biomodels_client-0.1.2.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 Jun 22, 2026.
Transparency logA 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.