Pyomeca is a python library allowing you to carry out a complete biomechanical analysis; in a simple, logical and concise way.
Pyomeca documentation
See Pyomeca's documentation site.
Example
Pyomeca implements specialized functionalities commonly used in biomechanics.
As an example, let's process the electromyographic data contained in this c3d file.
You can follow along without installing anything by using our binder server:
from pyomeca import Analogs
data_path = "../tests/data/markers_analogs.c3d"
muscles = [
"Delt_ant",
"Delt_med",
"Delt_post",
"Supra",
"Infra",
"Subscap",
]
emg = Analogs.from_c3d(data_path, suffix_delimiter=".", usecols=muscles)
emg.plot(x="time", col="channel", col_wrap=3)
emg_processed = (
emg.meca.band_pass(order=2, cutoff=[10, 425])
.meca.center()
.meca.abs()
.meca.low_pass(order=4, cutoff=5, freq=emg.rate)
.meca.normalize()
)
emg_processed.plot(x="time", col="channel", col_wrap=3)
import matplotlib.pyplot as plt
fig, axes = plt.subplots(ncols=2, figsize=(10, 4))
emg_processed.mean("channel").plot(ax=axes[0])
axes[0].set_title("Mean EMG activation")
emg_processed.plot.hist(ax=axes[1], bins=50)
axes[1].set_title("EMG activation distribution")
See the documentation for more details and examples.
Features
- Signal processing routine commonly used in biomechanics such as filters, normalization, onset detection, outliers detection, derivatives, etc.
- Common matrix manipulation routines implemented such as getting Euler angles to/from a rototranslation matrix, creating a system of axes, setting a rotation or translation, transpose or inverse, etc.
- Easy reading and writing interface to common files in biomechanics (
c3d,csv,xlsx,mat,trc,sto,mot) - All of xarray's awesome features
The following illustration shows all of pyomeca's public API. An interactive version is available in the documentation.
Installation
Pyomeca itself is a pure Python package, but its dependencies are not. The easiest way to get everything installed is to use conda.
To install pyomeca with its recommended dependencies using the conda command line tool:
conda install -c conda-forge pyomeca
Now that you have installed pyomeca, you should be able to import it:
import pyomeca
Integration with other modules
Pyomeca is designed to work well with other libraries that we have developed:
- pyosim: interface between OpenSim and pyomeca to perform batch musculoskeletal analyses
- ezc3d: Easy to use C3D reader/writer in C++, Python and Matlab
- biorbd: C++ interface and add-ons to the Rigid Body Dynamics Library, with Python and Matlab binders.
Bug reports & questions
Pyomeca is Apache-licensed and the source code is available on GitHub. If any questions or issues come up as you use pyomeca, please get in touch via GitHub issues. We welcome any input, feedback, bug reports, and contributions.
Citing Pyomeca
If you use pyomeca in your academic work, please consider citing our paper as:
@article{Martinez2020,
doi = {10.21105/joss.02431},
url = {https://doi.org/10.21105/joss.02431},
year = {2020},
publisher = {The Open Journal},
volume = {5},
number = {53},
pages = {2431},
author = {Romain Martinez and Benjamin Michaud and Mickael Begon},
title = {`pyomeca`: An Open-Source Framework for Biomechanical Analysis},
journal = {Journal of Open Source Software}
}
Please consider citing the xarray project, which pyomeca is based on:
@article{jors-xarray,
title = {Xarray: N-D labeled arrays and datasets in Python},
author = {Joe Hamman and Stephan Hoyer},
year = {2017},
journal = {Journal of Open Research Software}
}
Contributors
Pyomeca is an open-source project created and supported by the S2M lab.
Metadata
Release files for pyomeca 2026.0.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 |
|---|---|---|---|---|
| pyomeca-2026.0.2.tar.gz | 36.7 kB | With provenance | Details for pyomeca-2026.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyomeca-2026.0.2-py3-none-any.whl | Python 3 | none | any | Details for pyomeca-2026.0.2-py3-none-any.whl |
Total release size: 70.2 kB
Release files / pyomeca-2026.0.2.tar.gz
| Download URL | pyomeca-2026.0.2.tar.gz |
|---|---|
| Size | 36.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6dbddfaf992033baccde9167508fbff0a2f79b429cccd5e6f7dcde1396a25cf5
|
|
BLAKE2b-256 checksum How to use checksums |
45b6d499d350e4c577b2afc02d0c404afa0c5e236e3ee0503c6b4eba43f2675a
|
| 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 Aug 11, 2026.
Transparency logRelease files / pyomeca-2026.0.2-py3-none-any.whl
| Download URL | pyomeca-2026.0.2-py3-none-any.whl |
|---|---|
| Size | 33.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c41e49fb04bc1e5c7d6cc815e1f34737e988b0ea0bec7e68f056cde6361a929b
|
|
BLAKE2b-256 checksum How to use checksums |
4f8f293fde6db6687718d7ffa7bd8aeadfecba5c5c9c2d3919f141147baadba6
|
| 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 Aug 11, 2026.
Transparency logSecurity for pyomeca 2026.0.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 pyomeca-2026.0.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 Aug 11, 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.