skillfed

PyCifRW

CIF/STAR file support for Python

pycifrw v5.0.1 74.5K downloads/30d#14,826 on PyPI40
Permissive license Python 2.0 AGING released

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 pycifrw

uv

uv add pycifrw

poetry

poetry add pycifrw

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Python Software Foundation LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Scientific/Engineering :: Bio-InformaticsTopic :: Software Development :: Libraries :: Python Modules

Tags

CIF file parsercrystallographic data formatCIF reader writerSTAR file supportcrystallography data handlingscientific data format pythonCIF 2.0 parser
crystallographyscientific-datafile-format

More Python Modules packages