Skip to main content

openpls engine

A modern, maintained Python engine for Partial Least Squares Structural Equation Modeling (PLS-SEM).

CI Coverage PyPI version Python versions License: GPL-3.0-or-later DOI Validation DOI Validation paper (SSRN)

Documentation  ·  Quickstart  ·  API reference  ·  Changelog


openpls-engine is the compute core behind OpenPLS and a standalone PyPI package. It is a maintained fork of plspm-python by Jez Humble (Google), with the original algorithm kept intact and modern PLS-SEM reporting, advanced analyses, and two new inner-weighting schemes layered on top.

Status: stable as of 1.0.0. Public API follows semver. See the changelog for the version history.

Install

pip install openpls-engine

Pin a specific version for reproducible analyses:

pip install openpls-engine==1.14.0

Or work from source:

git clone https://github.com/jojacobsen/openpls-engine.git
cd openpls-engine
python3 -m pip install -e .

Quickstart

import pandas as pd
from openpls import Plspm
import openpls.config as c
from openpls.scheme import Scheme
from openpls.mode import Mode

satisfaction = pd.read_csv("tests/data/satisfaction.csv", index_col=0)

structure = c.Structure()
structure.add_path(["IMAG"], ["EXPE", "SAT", "LOY"])
structure.add_path(["EXPE"], ["QUAL", "VAL", "SAT"])
structure.add_path(["QUAL"], ["VAL", "SAT"])
structure.add_path(["VAL"],  ["SAT"])
structure.add_path(["SAT"],  ["LOY"])

config = c.Config(structure.path(), scaled=False)
for lv in ["IMAG", "EXPE", "QUAL", "VAL", "SAT", "LOY"]:
    config.add_lv_with_columns_named(lv, Mode.A, satisfaction, lv.lower())

fit = Plspm(satisfaction, config, Scheme.CENTROID)
print(fit.inner_summary())
print(fit.path_coefficients())
print(fit.report().reliability())  # alpha, rho_A, rho_C, AVE

See the Quickstart guide for the full walkthrough.

Use from an AI assistant (MCP)

The engine ships a local Model Context Protocol server, so an assistant like Claude or Cursor can inspect a dataset and fit a model by calling the engine directly on your machine. Nothing is uploaded: the tools read datasets from local file paths.

pip install "openpls-engine[mcp]"

Point your MCP client at the openpls-mcp command, e.g. in Claude Desktop / Claude Code config:

{
  "mcpServers": {
    "openpls": { "command": "openpls-mcp" }
  }
}

Two tools are exposed:

  • describe_dataset(path) — row count and per-column name/type for a local CSV/TSV/Excel file, so the assistant can pick indicator columns.
  • fit_pls_sem(data_path, latent_variables, structural_paths, scheme, scaled, missing_codes) — fit a model and get R² per construct, path coefficients (estimate, p-value, f²), reliability (Cronbach's α, ρ_A, ρ_C, AVE), model fit (SRMR, d_ULS) and the goodness-of-fit index.

What's inside

Quality criteria — HTMT and HTMT2 (geometric-mean refinement, Roemer et al. 2021), SRMR, d_ULS, Cronbach α, Dijkstra-Henseler ρ_A and ρ_C, adjusted R², BIC, Stone-Geisser Q² (blindfolding), Cohen f² effect sizes, Fornell-Larcker discriminant validity, per-indicator and per-predictor VIF, CTA-PLS (confirmatory tetrad analysis for reflective measurement).

Advanced analyses — PLSc (consistent-PLS bias correction, Dijkstra & Henseler 2015), Gaussian-copula endogeneity test (Park & Gupta 2012; Hult et al. 2018), disjoint two-stage higher-order constructs covering all four canonical types (R-R / R-F / F-R / F-F), IPMA (Importance-Performance Map Analysis), PLSpredict with the complete Shmueli et al. 2019 panel (RMSE / MAE / MAPE, in-sample + out-of-sample, PLS + LM benchmark), two-stage moderation, FIMIX-PLS finite-mixture segmentation, specific indirect effects with bootstrap percentile CIs, multi-group analysis with Henseler permutation tests, MICOM measurement invariance of composites (Henseler, Ringle & Sarstedt 2016) with three-step verdict, nomological validity (directional hypothesis tests on latent-variable correlations), the Lindell-Whitney marker-variable common-method-bias check, the Cross-Validated Predictive Ability Test (CVPAT, Liengaard et al. 2021), and the overall model-fit test (Bollen-Stine bootstrap, Dijkstra & Henseler 2015) reporting SRMR, d_ULS and the geodesic distance d_G against a reference distribution — the inferential fit test the composite-PLS tradition omits, validated against cSEM.

Engine internals — five inner-weighting schemes (Centroid, Factorial, Path plus the new quasi-Newton/BFGS and Lohmöller PCA schemes), mean-replacement missing-value strategy alongside the upstream casewise default, long-running bootstrap with BCa percentile CIs and progress streaming, publication-ready Plspm.report() that bundles every reviewer-standard panel for one-call export.

Documentation

Full docs at openpls.app/engine:

  • Introduction — what the library does and who it is for.
  • Installation — pip and source installs.
  • Quickstart — end-to-end fit on the satisfaction dataset.
  • Core concepts — PLS-SEM, Mode A/B, inner-weighting schemes, missing-value strategies.
  • API reference — the full public surface.
  • Examples — runnable snippets for each advanced analysis.
  • Changelog — version history with per-feature notes.

Development

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
pip install -e .

pytest          # run the test suite
ruff check .    # lint

CI runs lint and tests on Python 3.11 through 3.13 against every push and pull request against main.

Versioning

openpls-engine follows Semantic Versioning. The public API is stable as of 1.0.0. Tagged releases (vX.Y.Z) trigger a GitHub Actions workflow that builds the package and publishes it to PyPI via OIDC trusted publishing. The version is the single source of truth in pyproject.toml and is exposed at runtime as openpls.__version__. 1.0.0 renamed the import namespace from plspm to openpls; consumers upgrading from 0.7.x must rewrite their imports (see CHANGELOG → Breaking).

Cite

If you use openpls-engine in academic work, please cite the validation paper alongside the software:

Structured metadata is in CITATION.cff; GitHub renders a "Cite this repository" button from it.

License

GNU General Public License v3.0, see LICENSE. Inherited from upstream plspm-python (also GPL-3.0).

Attribution

This project is a fork of googlecloudplatform/plspm-python by Jez Humble. The upstream R package plspm by Gaston Sanchez and the seminr package by Soumya Ray and Nicholas Danks remain the conceptual references for the algorithm. See ATTRIBUTION.md for details.

OpenPLS is an independent project and not affiliated with Google.

Metadata

Release files for openpls-engine 1.14.0

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

Source distribution (sdist)

Source distribution for openpls-engine 1.14.0
File Size Uploaded Provenance Actions
openpls_engine-1.14.0.tar.gz 184.6 kB With provenance Details for openpls_engine-1.14.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openpls-engine 1.14.0
File Interpreter ABI Platform Actions
openpls_engine-1.14.0-py3-none-any.whl Python 3 none any Details for openpls_engine-1.14.0-py3-none-any.whl

Total release size: 343.7 kB

Release files / openpls_engine-1.14.0.tar.gz

Download URL openpls_engine-1.14.0.tar.gz
Size 184.6 kB
Tags Source
SHA-256 checksum
How to use checksums
896b5d6451bfe42ab501309f2c143f2031743741cf44e933fde708f75378e4b1
BLAKE2b-256 checksum
How to use checksums
7d3b405e9918a1a066121f62ea870353778b020f818555fb3355fb5bdfbaf6bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

Release files / openpls_engine-1.14.0-py3-none-any.whl

Download URL openpls_engine-1.14.0-py3-none-any.whl
Size 159.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa44c8ed7e30ff12b8fc2cbbf12892914cee12467e297f9bda7aa1e2b6f7fc8f
BLAKE2b-256 checksum
How to use checksums
fb92728c444c28bfea536bedc385b1081aba7795c3892b2ef9ce67021466c644
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

Security for openpls-engine 1.14.0

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 openpls_engine-1.14.0.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 28, 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