A modern pure-Python implementation of FieldML 0.5 with evaluation engine and biomechanics model zoo.
Project description
pyfieldml
A modern, pure-Python implementation of FieldML 0.5 with a full evaluation engine, interop bridges (meshio, PyVista, XDMF, scikit-fem, OpenSim-adjacent), and a curated biomechanics model zoo.
FieldML is the Physiome Project's declarative markup language for representing mathematical fields over discrete meshes — used across computational physiology (cardiac, musculoskeletal, respiratory modeling). The original C++ FieldML-API has been effectively unmaintained since 2015. pyfieldml is an independent reimplementation that brings FieldML into the modern scientific-Python ecosystem.
Status: design phase. The approved design spec lives at
docs/superpowers/specs/2026-04-18-pyfieldml-design.md. Implementation plan and phased build are next.
What it will do (v1.0)
- Full FieldML 0.5 read + write, round-trip validated against the C++ reference test suite
- Legacy read of FieldML 0.3 and 0.4 (auto up-conversion to 0.5)
- Evaluation engine with Lagrange (orders 1–2) and cubic Hermite-with-scaling bases
Field.evaluate(element, xi), vectorizedField.sample(points), Jacobians- High-level builders:
add_lagrange_mesh,add_fiber_field,add_material_field,add_landmark_set, … - Interop:
meshio(two-way), PyVista (doc.plot(),doc.explore()), XDMF,scikit-fem, OpenSim-compatible asset export - CLI:
pyfieldml inspect | validate | convert | plot | lint | diff - Curated model zoo:
pyfieldml.datasets.load_femur(),load_rectus_femoris(),load_myocardium() - Docs site with
jupyter-litein-browser runnable notebooks - JOSS paper submitted alongside v1.0
License
Apache 2.0. See LICENSE and NOTICE.
Install
pip install pyfieldml
Development:
git clone https://github.com/kchemorion/pyfieldml
cd pyfieldml
uv sync --extra dev
uv run pytest
Quickstart
import pyfieldml as fml
doc = fml.read("model.fieldml")
print(doc.source_version) # "0.5.0", "0.4", "0.3"
doc.validate() # XSD validation
doc.write("roundtripped.fieldml")
Phase 0 ships I/O and DOM-level round-trip. The semantic object model, evaluation engine, interop bridges, and model zoo arrive in later phases — see the design spec and plans.
Acknowledgments
pyfieldml is an independent Python reimplementation inspired by and validated against the C++ FieldML-API. Credit to its original authors — Caton Little, Alan Wu, Richard Christie, Andrew Miller, and Auckland Uniservices Ltd / the Auckland Bioengineering Institute — and to the Physiome Project community that maintains the FieldML specification.
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 pyfieldml-0.3.0.tar.gz.
File metadata
- Download URL: pyfieldml-0.3.0.tar.gz
- Upload date:
- Size: 152.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33e6a0f181526fe8e509a9daafb0e8b57bd5ea81f3533bbba3a3b9278566b92b
|
|
| MD5 |
03c2e7f66d4495e4d0220f2066743fde
|
|
| BLAKE2b-256 |
138726210d0d458cbe820155fef294fefc274e92fee7610d2f8a53ddade7a4a3
|
Provenance
The following attestation bundles were made for pyfieldml-0.3.0.tar.gz:
Publisher:
release.yml on kchemorion/pyfieldml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfieldml-0.3.0.tar.gz -
Subject digest:
33e6a0f181526fe8e509a9daafb0e8b57bd5ea81f3533bbba3a3b9278566b92b - Sigstore transparency entry: 1339991630
- Sigstore integration time:
-
Permalink:
kchemorion/pyfieldml@f67e90b506643ab07037751959f01107fdb0bd89 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/kchemorion
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f67e90b506643ab07037751959f01107fdb0bd89 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyfieldml-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pyfieldml-0.3.0-py3-none-any.whl
- Upload date:
- Size: 50.4 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 |
cca12ec43bbc4b954d43742830a53012f331bb0a8490b97e7dcd728e53c616df
|
|
| MD5 |
4f520c4c3c5068ccbf7c66912134402c
|
|
| BLAKE2b-256 |
ec376feb0bf1d08447b8bc7d29f584ba722ba61f27ab2c95c6201c5162c09a92
|
Provenance
The following attestation bundles were made for pyfieldml-0.3.0-py3-none-any.whl:
Publisher:
release.yml on kchemorion/pyfieldml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfieldml-0.3.0-py3-none-any.whl -
Subject digest:
cca12ec43bbc4b954d43742830a53012f331bb0a8490b97e7dcd728e53c616df - Sigstore transparency entry: 1339991631
- Sigstore integration time:
-
Permalink:
kchemorion/pyfieldml@f67e90b506643ab07037751959f01107fdb0bd89 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/kchemorion
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f67e90b506643ab07037751959f01107fdb0bd89 -
Trigger Event:
push
-
Statement type: