alterlab-pymatgen — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited alterlab-pymatgen (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Pymatgen is a comprehensive Python library for materials analysis that powers the Materials Project. Create, analyze, and manipulate crystal structures and molecules; compute phase diagrams and thermodynamic properties; analyze electronic structure (band structures, DOS); generate surfaces and interfaces; and access the Materials Project database. Supports 100+ file formats from various computational codes.
Use when:
| Scenario | Use Instead |
|---|---|
| Small organic molecules — SMILES, fingerprints, descriptors, substructure search | alterlab-rdkit |
| Running DFT / conformer searches / pKa in a managed cloud quantum-chemistry service | alterlab-rowan |
| Classical molecular dynamics of proteins or ligands (OpenMM, trajectories) | alterlab-molecular-dynamics |
| Variational quantum circuits for molecular ground states (VQE) | alterlab-pennylane |
uv pip install pymatgen # core (Python >= 3.11)
uv pip install pymatgen mp-api # + Materials Project API access
uv pip install "pymatgen[optional]" # extra analysis deps (phonopy, seekpath, ase, ...)
uv pip install "pymatgen[vis]" # VTK structure visualizationfrom pymatgen.core import Structure, Lattice
struct = Structure.from_file("POSCAR") # auto format detection
struct.to(filename="structure.cif") # write any format
print(struct.composition.reduced_formula)
print(struct.get_space_group_info())
print(f"{struct.density:.2f} g/cm³")export MP_API_KEY="your_api_key_here" # for Materials Project accessEach capability has a copy-paste code block in references/core_examples.md and deeper module docs in the references listed below.
space group), transformations (supercell, substitution, primitive). → core_classes.md
from_file()/to() plus scripts/structure_converter.pyfor single/batch. → io_formats.md
SpacegroupAnalyzer, CrystalNN, plusscripts/structure_analyzer.py. → analysis_modules.md
PhaseDiagram, energy-above-hull, decomposition,plus scripts/phase_diagram_generator.py. → analysis_modules.md, transformations_workflows.md
Vasprun, band gaps,metallicity. → analysis_modules.md, io_formats.md
SlabGenerator, WulffShape, AdsorbateSiteFinder.→ analysis_modules.md, transformations_workflows.md
MPRester search and retrieval with property filters.→ materials_project_api.md
MPRelaxSet, MPStaticSet,MPNonSCFSet), Gaussian, Quantum ESPRESSO. → io_formats.md, transformations_workflows.md
→ analysis_modules.md
Multi-step worked examples (high-throughput generation, band-structure pipeline, surface energy): references/common_workflows_code.md.
scripts/)detection). Usage: python scripts/structure_converter.py POSCAR structure.cif
matrix. Usage: python scripts/structure_analyzer.py structure.cif --symmetry --neighbors
analysis. Usage: python scripts/phase_diagram_generator.py Li-Fe-O --analyze "LiFeO2"
All scripts include detailed help, e.g. python scripts/structure_converter.py --help
references/)Structures: use auto format detection; prefer IStructure when immutable; reduce to primitive cell with SpacegroupAnalyzer; validate for overlapping atoms / bad bond lengths. File I/O: prefer from_file()/to(); specify format when detection fails; use as_dict()/from_dict() for version-safe storage. MP API: always use the context manager; batch queries; cache results; filter by property. Workflows: prefer input sets over manual INCAR; verify convergence; track transformations for provenance. Performance: use primitive cells; bound neighbor-search cutoffs; parallelize where possible.
Lengths in Å, energies in eV, angles in degrees, magnetic moments in μB, time in fs. Convert with pymatgen.core.units.
Integrates with ASE, Phonopy, BoltzTraP, Atomate/Fireworks, AiiDA, Zeo++, and OpenBabel.
uv pip install "pymatgen[optional,vis]" (there is no [analysis] extra)export MP_API_KEY="your_key_here"Structure.from_file("file.txt", fmt="cif")SpacegroupAnalyzer(struct, symprec=0.1)Docs: https://pymatgen.org/ · Materials Project: https://materialsproject.org/ · GitHub: https://github.com/materialsproject/pymatgen · Forum: https://matsci.org/ · Example notebooks: https://github.com/materialsvirtuallab/matgenb
Designed for pymatgen 2024.x and later (current 2026.9.x as of 2026-09; calendar versioning). Since 2026 the pymatgen distribution is a thin package on top of pymatgen-core; imports (pymatgen.core, pymatgen.io.vasp, …) are unchanged. For the Materials Project API use the mp-api package (current 0.46.x; from mp_api.client import MPRester) rather than the legacy pymatgen.ext.matproj client. Requirements: Python ≥ 3.11, pymatgen ≥ 2024.x, mp-api for Materials Project access.
Part of the AlterLab Academic Skills suite.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.