pymatgen
Python Materials Genomics is a robust materials analysis code that defines core object representations for structures
What it is and what it does
Pymatgen is a materials analysis library that provides object-oriented representations of crystalline structures, molecules, and sites, along with tools for reading and writing computational chemistry file formats (VASP, ABINIT, Gaussian, CIF, XYZ, and others). It is used by thousands of researchers and underpins the Materials Project, a large-scale materials database and analysis platform.
The library includes analysis capabilities for phase diagrams, Pourbaix diagrams, diffusion analysis, reaction pathways, and electronic structure properties like density of states and band structure. It integrates with the Materials Project REST API and is optimized for coordinate manipulations using NumPy and SciPy vectorization. The codebase is actively maintained by the Materialyze Lab, the ABINIT group, and other research teams, with continuous integration testing and a growing ecosystem of community add-ons.
Use it for:
- Parse and manipulate crystal structures from VASP, ABINIT, or Gaussian output files for post-processing analysis
- Generate phase diagrams and Pourbaix diagrams for thermodynamic stability assessment
- Analyze electronic structure data including band structures and density of states
- Query and download structures and properties from the Materials Project database
- Automate high-throughput computational materials workflows with standardized structure handling
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pymatgen provides Python classes and analysis tools for materials science workflows, including structure representation, file I/O for computational chemistry formats (VASP, ABINIT, Gaussian, CIF), phase diagrams, electronic structure analysis, and integration with the Materials Project REST API.
Yes. Pymatgen is a mature, actively maintained library with no known vulnerabilities, low install friction, and broad adoption in computational materials science. The MIT license imposes no restrictions. Install it if you work with crystal structures, computational chemistry outputs, or materials databases; skip it if your work does not involve materials analysis.
Install
pymatgen on PyPI
pip
pip install pymatgenuv
uv add pymatgenpoetry
poetry add pymatgenInstalling pymatgen
Before you install
Low install friction with a single runtime dependency (pymatgen-core). Active maintenance with last commit 2026-08-13 and continuous integration via GitHub Actions. Used by thousands of researchers and powers the Materials Project analysis pipeline.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both academic and commercial projects. No copyleft obligations.
Quickstart
pip install pymatgen
from pymatgen.core import Structure
struct = Structure.from_file('structure.cif')
Requires Python 3.11 or later. Some functionality (e.g., POTCAR generation) requires additional setup beyond the base install.
Verify before relying
- Specific performance characteristics for large structure datasets or high-throughput workflows
- Completeness of Materials Project REST API integration and any rate-limiting behavior
- Availability and maturity of the add-on ecosystem mentioned in the description
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pymatgen-core |
| Maintenance | actively maintained — 102 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 929,373/month — #4,705 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymatgen-2026.5.4-py3-none-any.whl
Keywords: ABINIT, VASP, analysis, crystal, diagrams, electronic, gaussian, materials, nwchem, phase, project, qchem, science, structure
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pymatgen-corepymatgen-core provides core data structures and…
permissive · top 15,000 on PyPI
mp-apiA Python client for querying and downloading…
permissive · top 15,000 on PyPI
pymatgen-io-validationValidates VASP electronic structure calculation…
permissive · top 15,000 on PyPI
emmet-coreEmmet-core provides the core data models,…
permissive · top 15,000 on PyPI
atomate2Atomate2 provides a library of pre-built…
permissive · top 15,000 on PyPI
vasprun-xmlParses VASP calculation output from vasprun.xml…
permissive · top 15,000 on PyPI
dpdatadpdata converts and manipulates atomistic…
copyleft · top 15,000 on PyPI
pyxtalPyXtal generates crystal structures with…
permissive · top 15,000 on PyPI
chgnetCHGNet is a pretrained graph neural network…
permissive · top 15,000 on PyPI
maggmaMaggma provides a unified interface for…
unclear · top 15,000 on PyPI