patsy
A Python package for describing statistical models and for building design matrices.
Install
patsy on PyPI
pip
pip install patsyuv
uv add patsypoetry
poetry add patsyPackage facts
| License | 2-clause BSD (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 297 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: patsy-1.0.2-py2.py3-none-any.whl
About patsy
from the package's own PyPI description — quoted content, verbatim
Patsy
Notice: patsy is no longer under active development. As of August 2021,
Matthew Wardrop (@matthewwardrop) and Tomás Capretto (@tomicapretto) have taken
on responsibility from Nathaniel Smith (@njsmith) for keeping the lights on, but
no new feature development is planned. The spiritual successor of this project
is Formulaic, and we
recommend that users migrate
when possible. For the time being, until major software packages have successfully
transitioned, we will attempt to keep patsy working in its current state with
current releases in the Python ecosystem.
Patsy is a Python library for describing statistical models (especially linear models, or models that have a linear component) and building design matrices. Patsy brings the convenience of R "formulas" to Python.
PyPI - Version (image) ![PyPI - Python...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Patsy builds design matrices for statistical models using R-style formula syntax, enabling convenient specification of linear models and related statistical analyses in Python.
Installation is straightforward with a single runtime dependency (numpy) and a pure-Python wheel. The package is actively maintained despite being in maintenance-only mode; the last commit is recent and the repository remains active.
Patsy is licensed under the 2-clause BSD license, a permissive open-source license that allows commercial and private use with minimal restrictions beyond attribution and liability disclaimers.
Usage
pip install patsy
import patsy
design_matrix = patsy.dmatrix('y ~ x1 + x2', data={'y': [1, 2, 3], 'x1': [0, 1, 2], 'x2': [1, 1, 1]})
Requires Python 3.6 or later; scipy is optional but needed for spline functions like bs().
Verdict: Patsy is a mature, well-maintained library for statistical model specification that fills a specific niche in bringing R's formula convenience to Python. While no new features are planned and the project recommends Formulaic for new work, it remains actively supported for current Python versions and carries no known vulnerabilities, making it safe for existing codebases.
Needs verification
- Whether scipy integration for spline functions (bs, cc, etc.) is fully tested in current Python 3.10–3.13 environments
- Adoption rate and stability track record among major downstream packages (statsmodels, scikit-learn, etc.) that may depend on patsy
Similar packages
permissive · top 1,000 on PyPI
numpypermissive · top 100 on PyPI
nvidia-cusolverunclear · top 1,000 on PyPI
nvidia-cusolver-cu12unclear · top 1,000 on PyPI
scipypermissive · top 100 on PyPI
nvidia-cusparseunclear · top 1,000 on PyPI
nvidia-cusparse-cu12unclear · top 1,000 on PyPI
nvidia-cublasunclear · top 1,000 on PyPI
nvidia-cublas-cu12unclear · top 1,000 on PyPI
outcomepermissive · top 1,000 on PyPI