Python API for cpptraj: a data analysis package for biomolecular simulation

ambermd, ambertools, interactive-analysis, molecular-dynamics, trajectory-analysis, visualization
pip install pytraj==2.0.5


Install | Features | How to get started? | Visualization

Build Status Binstar Badge PyPI version Coverage Status

pytraj website


A Python front-end of [cpptraj program] ( (a data analysis package for biomolecular simulation).



  • support more than 80 types of data analyses (rmsd, radgyr, autoimage, pca, clustering,...)
  • read/write various file formats (.nc, .mdcrd, .dcd, .trr, .xtc, .pdb, .mol2, ...)
  • fast (core codes were written in C++ and Cython)
  • support parallel calculation with trivial installation (openmp, multiprocessing, mpi, ...)
  • interactive analysis with large trajectory data that does not fit to memory
  • [>> many more with comprehensive tutorials] (


Supported platforms: Linux, OSX

  • from AMBER suite distribution

  • from conda: conda install -c ambermd pytraj

  • from pip: pip install pytraj

  • from source code:

    git clone
    cd pytraj
    python install
    # Note: openmp will be turned off in OSX.
    # AMBER user: overwrite pytraj in $AMBERHOME
    python install --prefix=$AMBERHOME
  • getting trouble? : check our webpage

How to get started?

Contributors and Acknowledgement

Please check here


If you would like to acknowledge our work, please cite both cpptraj and pytraj papers.

something like:

"...used pytraj [1], a Python package binding to cpptraj program [2]"
  • [1] PYTRAJ: Interactive data analysis for molecular dynamics simulations. Hai Nguyen, Daniel R. Roe, Jason Swails, David A. Case. (2016)

  • [2] [PTRAJ and CPPTRAJ] ( Software for Processing and Analysis of Molecular Dynamics Trajectory Data. Daniel R. Roe and Thomas E. Cheatham, III Journal of Chemical Theory and Computation 2013 9 (7), 3084-3095


nglview with pytraj in Jupyter notebook

Demo: Interactive data exploration with [Jupyter notebook] (

pytraj website


GPL v3 (since pytraj is derived work of cpptraj)

But if you would like to reuse code snippets and pieces independent of cpptraj, I am (Hai) happy to license them (pieces of codes) under BSD-2 Clause or whatever you like. Just buzz us.