mdtraj
MDTraj: A modern, open library for the analysis of molecular dynamics trajectories
Decision gist · record as of 2026-08-14
Yes, if you work with molecular dynamics simulations and need trajectory analysis. The library is stable, well-maintained for bug fixes, and provides a comprehensive API for common MD post-processing tasks. The LGPLv2.1+ copyleft license requires careful review if you plan to distribute derivative works or link it into proprietary software. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a molecular dynamics trajectory file and topology file in a supported format (e.g., xtc, pdb, dcd, netcdf).
- Medium install friction with prebuilt wheels for Python 3.11–3.14 across macOS, Linux, and Windows.
- Last release 37 days ago; repository active but in maintenance mode with no major feature development planned.
License · maintenance · safety
LGPLv2.1+ (copyleft) — Licensed under LGPLv2.1+, a copyleft license. Derivative works and modifications must be distributed under compatible terms; proprietary use requires careful review of linking and distribution obligations.
last release 2026-07-08 (37 days) · last repo commit 2022-05-04
0 known vulnerabilities (OSV.dev, 2026-08-14) · 221,121 downloads/mo, #9,284 on PyPI
Alternatives
Verify before relying
import mdtraj as md
traj = md.load('trajectory.xtc', top='topology.pdb')
rmsd = md.rmsd(traj, traj[0])
print(rmsd)- Whether the package's C extensions require compilation or system libraries on all supported platforms.
- Current state of community support and response time given maintenance-mode status.
- Performance characteristics of analysis functions beyond RMSD on large trajectories.
What it is and what it does
MDTraj is a Python library for reading, writing, and analyzing molecular dynamics simulation trajectories. It abstracts over many trajectory file formats (xtc, trr, dcd, pdb, netcdf, gsd, and others) and provides a unified interface for structural analysis. The library emphasizes speed and vectorized operations, with optimized RMSD calculations and built-in functions for computing bonds, angles, dihedrals, hydrogen bonding networks, and secondary structure assignments.
The package is designed for computational chemistry and biophysics researchers who need to post-process MD simulations. It depends on numpy, scipy, pyparsing, and packaging. The library is in maintenance mode—bug fixes and documentation improvements are welcome, but major new features are not actively planned. It requires Python 3.11 or later and is available as prebuilt wheels for current Python versions on macOS, Linux, and Windows.
Use it for
- Load and convert molecular dynamics trajectories between different file formats (xtc, dcd, pdb, netcdf) for interoperability.
- Calculate root-mean-square deviation (RMSD) between protein conformations to measure structural similarity over time.
- Identify and analyze hydrogen bonding patterns and networks within a trajectory ensemble.
- Assign secondary structure (alpha helix, beta sheet) to protein residues across trajectory frames.
- Extract and analyze dihedral angles, bond lengths, and other geometric properties for validation or feature extraction.
- Prepare trajectory data for downstream machine learning or statistical analysis pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with molecular dynamics simulations and need trajectory analysis.
The library is stable, well-maintained for bug fixes, and provides a comprehensive API for common MD post-processing tasks. The LGPLv2.1+ copyleft license requires careful review if you plan to distribute derivative works or link it into proprietary software. No known security vulnerabilities.
Install
mdtraj on PyPI
Before you install
Medium install friction with prebuilt wheels for Python 3.11–3.14 across macOS, Linux, and Windows. Last release 37 days ago; repository active but in maintenance mode with no major feature development planned.
Requires a molecular dynamics trajectory file and topology file in a supported format (e.g., xtc, pdb, dcd, netcdf).
License in practice
Licensed under LGPLv2.1+, a copyleft license. Derivative works and modifications must be distributed under compatible terms; proprietary use requires careful review of linking and distribution obligations.
Quickstart
import mdtraj as md
traj = md.load('trajectory.xtc', top='topology.pdb')
rmsd = md.rmsd(traj, traj[0])
print(rmsd)
Verify before relying
- Whether the package's C extensions require compilation or system libraries on all supported platforms.
- Current state of community support and response time given maintenance-mode status.
- Performance characteristics of analysis functions beyond RMSD on large trajectories.
Package facts
| License | LGPLv2.1+ copyleft |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 4 packagesnumpyscipypyparsingpackaging |
| Maintenance | Actively maintained 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 221,121 / month, #9,284 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Operating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Bio-InformaticsTopic :: Scientific/Engineering :: Chemistry |
Evidence: mdtraj-1.11.1.post2-cp311-cp311-macosx_10_9_universal2.whl; mdtraj-1.11.1.post2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; mdtraj-1.11.1.post2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdtraj-1.11.1.post2-cp311-cp311-win_amd64.whl; mdtraj-1.11.1.post2-cp312-cp312-macosx_10_13_universal2.whl; mdtraj-1.11.1.post2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; mdtraj-1.11.1.post2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdtraj-1.11.1.post2-cp312-cp312-win_amd64.whl; mdtraj-1.11.1.post2-cp313-cp313-macosx_10_13_universal2.whl; mdtraj-1.11.1.post2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; mdtraj-1.11.1.post2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdtraj-1.11.1.post2-cp313-cp313-win_amd64.whl; mdtraj-1.11.1.post2-cp314-cp314-macosx_10_15_universal2.whl; mdtraj-1.11.1.post2-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; mdtraj-1.11.1.post2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mdtraj-1.11.1.post2-cp314-cp314-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “molecular dynamics trajectory analysis”
- mdtrajMDTraj reads, writes, and analyzes molecular dynamics trajectories in…
- MDAnalysisMDAnalysis reads and analyzes molecular dynamics simulation…
- biotrajReads and writes molecular dynamics trajectory files in XTC, TRR,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Bio-Informatics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
Biopython provides Python tools for computational molecular biology, including sequence analysis, structure parsing, database access, and phylogenetic tree manipulation.
However, verify that the custom Biopython License Agreement aligns with your project's licensing requirements before committing to it in production or proprietary work.
Client library for the Firecrawl API that scrapes, crawls, and searches the web, returning clean Markdown or structured data; also indexes research papers from PubMed, bioRxiv, medRxiv, and arXiv.
A self-balancing interval tree data structure that stores and queries overlapping or enveloped ranges, supporting point lookups, range overlaps, and range envelopment queries.
Install it if you need to store and query overlapping or enveloped ranges; the self-balancing design and rich query interface make it significantly easier than…
Albumentations applies image transformations to training data, supporting classification, segmentation, object detection, and pose estimation with a unified API for images, masks, bounding boxes, and keypoints.
Install it if you need a unified, production-grade augmentation API for computer vision tasks.
PubChemPy is a Python wrapper around the PubChem REST API that lets you search for chemical compounds by name, substructure, or similarity, retrieve their properties, and convert between chemical file formats.
Install it if you need programmatic access to PubChem data.
See also biotraj · MDAnalysis · pydssp · alchemlyb · pdb2pqr · OpenMM · prolif · ViennaRNA · ase · py3Dmol