A primitive Python wrapper around the Gromacs tools. The library is tested with GROMACS 4.6.5, 2018.x, 2019.x, 2020.x, and 2021.x (and 5.x and 2016.x should also work). It supports Python 2.7 and 3.6--3.9 on Linux and macOS.

GromacsWrapper also provides a small library (cook book) of often-used recipes and helper functions to set up MD simulations.

Please be aware that this is beta software that most definitely contains bugs. It is your responsibility to ensure that you are running simulations with sensible parameters.

Quick Start

Given a PDB file 1iee.pdb, set up and run a simple simulation (assuming you have all other input files at hand such as the MDP files):

>>> import gromacs
>>> print(gromacs.release)
>>> help(gromacs.pdb2gmx)

gmx pdb2gmx reads a .pdb (or .gro) file, reads some database files,
adds hydrogens to the molecules and generates coordinates in GROMACS

Options to specify input files:

-f      [<.gro/.g96/...>]  (eiwit.pdb)
          Structure file: gro g96 pdb brk ent esp tpr
>>> gromacs.pdb2gmx(f="1iee.pdb", o="protein.gro", p="",
...                 ff="oplsaa", water="tip4p")
>>> gromacs.editconf(f="protein.gro", o="boxed.gro",
...                  bt="dodecahedron", d=1.5, princ=True,
...                  input="Protein")
>>> gromacs.solvate(cp="boxed.gro", cs="tip4p", p="",
...                 o="solvated.gro")
>>> gromacs.grompp(f="emin.mdp", c="solvated.gro", p="",
...                o="emin.tpr")
>>> gromacs.mdrun(v=True, deffnm="emin")
>>> gromacs.grompp(f="md.mdp", c="emin.gro", p="", o="md.tpr")
>>> gromacs.mdrun(v=True, deffnm="md")


The GromacsWrapper package is made available under the terms of the GNU Public License v3 (or any higher version at your choice) except as noted below. See the file COPYING for the licensing terms for all modules.



The latest version of GromacsWrapper from PyPi and can be installed with

pip install GromacsWrapper

Development version

The master branch in the GitHub source repository generally contains useful code but nevertheless, things can break in weird and wonderful ways. Please report issues through the Issue Tracker and mention that you used the develop branch.

To use the development code base: checkout the master branch:

git clone
cd GromacsWrapper

and install

python install

Download and Availability

The GromacsWrapper home page is The latest release of the package is being made available from

You can also clone the GromacsWrapper git repository or fork for your own development:

git clone git://