PyCifRW
CIF/STAR file support for Python
What it is and what it does
PyCIFRW is a parser and writer for CIF (Crystallographic Information Format) and STAR files, used primarily in crystallography and structural biology to exchange and manipulate scientific data. It exposes CIF files as nested Python dictionaries, where each top-level key is a data block and nested keys are data names, making it natural to read, modify, and write crystallographic metadata programmatically.
The package depends on prettytable, ply, and numpy, and is written entirely in Python with an optional C extension included. It has been tested against IUCr sample CIF 1.1 files and conforms to CIF 1.0, 1.1, and 2.0 specifications. It runs on macOS, Windows, and Linux, with prebuilt wheels available for Python 3.10–3.13.
Use it for:
- Parse crystallographic data files from synchrotron beamlines or X-ray diffraction experiments to extract metadata.
- Validate CIF files against data dictionaries using included utilities.
- Programmatically modify and write back CIF files in data processing pipelines.
- Convert CIF data dictionaries to documentation formats like asciidoc.
- Integrate crystallographic data handling into larger scientific Python applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyCIFRW reads and writes CIF (Crystallographic Information Format) files, exposing them as nested Python dictionaries for programmatic access to crystallographic data.
Yes, if you work with CIF files in crystallography or structural biology. The package is stable, permissively licensed, and has no known vulnerabilities. Install friction is moderate due to compiled wheels, but prebuilt binaries are available for recent Python versions. Maintenance is aging (last release 508 days ago), so consider it mature rather than actively developed—suitable for production use but not for projects requiring frequent updates.
Install
pycifrw on PyPI
pip
pip install pycifrwuv
uv add pycifrwpoetry
poetry add pycifrwInstalling PyCifRW
Before you install
Medium install friction due to compiled wheels across multiple Python versions (3.10–3.13) and platforms, but prebuilt binaries are available. Maintenance status is aging—last release was 508 days ago, though the repository remains active and the package has been stable since its 2009 inception.
License in practice
Licensed under Python 2.0 (permissive), a BSD-like license that permits modification and redistribution with minimal restrictions, provided copyright notice and a summary of changes are retained in derivative works.
Quickstart
pip install pycifrw
import CifFile
cf = CifFile.ReadCif('example.cif')
wavelength = cf['si_std']['_diffrn_meas_wavelength']
Verify before relying
- Whether Python version support is truly unspecified or if there is a practical minimum version requirement.
- Current test coverage and whether the 180 tests in TestPyCIFRW.py are regularly executed.
- Whether the C extension module mentioned in the distribution is required or optional for performance.
Package facts
| License | Python 2.0 (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 3 — prettytable, ply, numpy |
| Maintenance | aging — 508 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 74,482/month — #14,826 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pycifrw-5.0.1-cp310-cp310-macosx_10_9_x86_64.whl; pycifrw-5.0.1-cp310-cp310-macosx_11_0_arm64.whl; pycifrw-5.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pycifrw-5.0.1-cp310-cp310-win32.whl; pycifrw-5.0.1-cp310-cp310-win_amd64.whl; pycifrw-5.0.1-cp311-cp311-macosx_10_9_x86_64.whl; pycifrw-5.0.1-cp311-cp311-macosx_11_0_arm64.whl; pycifrw-5.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pycifrw-5.0.1-cp311-cp311-win32.whl; pycifrw-5.0.1-cp311-cp311-win_amd64.whl; pycifrw-5.0.1-cp312-cp312-macosx_10_13_x86_64.whl; pycifrw-5.0.1-cp312-cp312-macosx_11_0_arm64.whl; pycifrw-5.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pycifrw-5.0.1-cp312-cp312-win32.whl; pycifrw-5.0.1-cp312-cp312-win_amd64.whl; pycifrw-5.0.1-cp313-cp313-macosx_10_13_x86_64.whl; pycifrw-5.0.1-cp313-cp313-macosx_11_0_arm64.whl; pycifrw-5.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pycifrw-5.0.1-cp313-cp313-win32.whl; pycifrw-5.0.1-cp313-cp313-win_amd64.whl
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
gemmiGemmi is a C++ library with Python bindings for…
copyleft · top 5,000 on PyPI
pynwbPyNWB provides a high-level Python API for…
permissive · top 15,000 on PyPI
spglibspglib provides Python bindings to a C library…
permissive · top 5,000 on PyPI
pymatgenPymatgen provides Python classes and analysis…
permissive · top 5,000 on PyPI
noneA library providing additional utilities and…
permissive · top 15,000 on PyPI
pymatgen-corepymatgen-core provides core data structures and…
permissive · top 15,000 on PyPI
pyliblzfseProvides Python bindings for LZFSE and LZVN…
permissive · top 15,000 on PyPI
moyopyMoyopy is a Python binding for Moyo, a crystal…
permissive · top 15,000 on PyPI
mrcfilemrcfile reads and writes MRC2014 format files…
permissive · top 15,000 on PyPI
silxsilx provides Python tools for reading,…
permissive · top 15,000 on PyPI