skillfed

gemmi

library for structural biology

gemmi v0.7.5 1.1M downloads/30d#4,337 on PyPI377
Copyleft license MPL-2.0 Active released

What it is and what it does

Gemmi is a C++ library designed for structural biology and crystallography, providing Python bindings to read, write, and manipulate macromolecular models, crystallographic reflections, electron density maps, and CIF/STAR files. It handles data from PDB, mmCIF, mmJSON, MTZ, and MRC/CCP4 formats, and includes support for crystallographic symmetries and refinement restraints. The library is developed by CCP4 and Global Phasing Ltd, two established providers of crystallography software.

The package is distributed as precompiled wheels for common platforms, reducing installation friction for most users. It has no runtime dependencies beyond Python itself, making it straightforward to integrate into existing workflows. The project is actively maintained, with recent commits and no known security vulnerabilities, making it a stable choice for structural biology applications.

Use it for:

  • Parse and manipulate protein structures from PDB or mmCIF files in structural biology pipelines
  • Extract and analyze crystallographic symmetry information for structure validation
  • Read and process crystallographic reflection data (MTZ files) in refinement workflows
  • Convert between structural file formats (PDB, mmCIF, mmJSON) in data preparation
  • Access electron density maps and other volumetric data for visualization or analysis
  • Build command-line tools for batch processing of macromolecular structures

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Gemmi is a C++ library with Python bindings for reading, writing, and manipulating macromolecular structural data (PDB, mmCIF, MTZ files) and crystallographic information, including symmetries, density maps, and refinement restraints.

Yes, if you work with macromolecular structures or crystallographic data. Gemmi is actively maintained, has no known vulnerabilities, and offers precompiled wheels for common platforms. The copyleft license (MPL-2.0 or LGPLv3) is standard in academic software but requires attention if you plan to redistribute derivative works. Medium install friction is typical for C++ bindings and not a barrier for most workflows.

Install

gemmi on PyPI

pip

pip install gemmi

uv

uv add gemmi

poetry

poetry add gemmi

Installing gemmi

Before you install

Medium install friction due to compiled C++ bindings, but wheels are provided for current Python versions across macOS, Linux, and Windows. Repository is active with recent commits and no known vulnerabilities.

License in practice

Licensed under MPL-2.0 (copyleft), or LGPLv3 at your option. Copyleft terms require derivative works to be distributed under compatible licenses; choose LGPLv3 if that constraint is problematic for your use case.

Quickstart

pip install gemmi

import gemmi

# Read a PDB file
doc = gemmi.read_pdb('structure.pdb')
model = doc[0]
for chain in model:
    for residue in chain:
        print(residue.name)

Requires Python >=3.9. Compiled wheels available for common platforms; source build requires a C++14 compiler.

Verify before relying

  • Whether the library's command-line tools are accessible after pip install or require separate installation
  • Performance characteristics for large structures or batch processing workflows
  • Maturity level of the Fortran interface and WebAssembly bindings mentioned in the description
  • Which specific Python versions are covered by the precompiled wheels beyond the friction evidence shown

Package facts

License MPL-2.0 (copyleft)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 165 days since the last release
Last repo commit
First released
Downloads 1,120,899/month — #4,337 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: gemmi-0.7.5-cp310-cp310-macosx_10_14_x86_64.whl; gemmi-0.7.5-cp310-cp310-macosx_11_0_arm64.whl; gemmi-0.7.5-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; gemmi-0.7.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; gemmi-0.7.5-cp310-cp310-win_amd64.whl; gemmi-0.7.5-cp311-cp311-macosx_10_14_x86_64.whl; gemmi-0.7.5-cp311-cp311-macosx_11_0_arm64.whl; gemmi-0.7.5-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; gemmi-0.7.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; gemmi-0.7.5-cp311-cp311-musllinux_1_2_aarch64.whl; gemmi-0.7.5-cp311-cp311-musllinux_1_2_x86_64.whl; gemmi-0.7.5-cp311-cp311-win_amd64.whl; gemmi-0.7.5-cp312-cp312-macosx_10_14_x86_64.whl; gemmi-0.7.5-cp312-cp312-macosx_11_0_arm64.whl; gemmi-0.7.5-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; gemmi-0.7.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; gemmi-0.7.5-cp312-cp312-musllinux_1_2_aarch64.whl; gemmi-0.7.5-cp312-cp312-musllinux_1_2_x86_64.whl; gemmi-0.7.5-cp312-cp312-win_amd64.whl; gemmi-0.7.5-cp313-cp313-macosx_10_14_x86_64.whl

Keywords: structural bioinformatics, structural biology, crystallography, CIF, mmCIF, PDB, CCP4, MTZ

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Programming Language :: C++Programming Language :: PythonTopic :: Scientific/Engineering :: Bio-InformaticsTopic :: Scientific/Engineering :: ChemistryTopic :: Software Development :: Libraries :: Python Modules

Tags

PDB file parsingcrystallography data handlingmacromolecular structuremmCIF readerstructural biology toolkitcrystallographic symmetryMTZ reflection datamolecular model processing
structural-biologycrystallographyfile-formats

More Python Modules packages