--- id: mrcfile version: "1.5.4" license: BSD license_treatment: permissive maintenance: active --- # mrcfile — MRC file I/O library License: permissive · Maintenance: active · Downloads: 434.1K/mo ## What it is and what it does mrcfile is a Python library for reading and writing MRC2014 format files, the standard format for storing 3D image and volume data in structural biology and cryo-electron microscopy. It provides a clean, simple API that exposes file headers and data as numpy arrays, making it easy to inspect, modify, and save MRC files without compiled dependencies beyond numpy itself. The library supports gzip and bzip2 compressed files, includes validation against the MRC2014 specification, and offers memory-mapped access for efficient random access to large files. It runs on Python 2.7 and modern Python 3 versions across Linux, macOS, and Windows, and is actively maintained as part of the CCP-EM software suite used in structural biology research. Use it for: - Load and inspect 3D electron microscopy density maps in cryo-EM workflows - Create and modify MRC format files programmatically in image processing pipelines - Validate MRC file headers and data compliance with the MRC2014 standard - Access large volume datasets efficiently using memory-mapped file mode - Convert between MRC format and numpy arrays for analysis in scientific Python code ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. mrcfile reads and writes MRC2014 format files used in structural biology to store image and volume data, exposing headers and data as numpy arrays through a simple Python API. Yes. mrcfile is a stable, actively maintained library with low install friction (numpy only) and no known vulnerabilities. It fills a specific, well-defined role in structural biology workflows. Install it if you work with MRC format files in cryo-EM or related fields; skip it if you have no need for MRC file I/O. ## Install pip install mrcfile uv add mrcfile poetry add mrcfile ## Installing mrcfile Before you install: Low friction: pure Python wheel with only numpy as a runtime dependency. Active maintenance with recent commits and a stable release history since 2016. License in practice: BSD permissive license allows commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install mrcfile import mrcfile import numpy as np with mrcfile.open('file.mrc') as mrc: data_slice = mrc.data[10, 10] array = np.zeros((5, 5), dtype=np.int8) with mrcfile.new('output.mrc') as mrc: mrc.set_data(array) mrc.data[1:4, 1:4] = 10 Verify before relying: - Whether memory-mapped and asynchronous file loading features are production-ready and documented - Performance characteristics for very large files relative to alternatives ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 434.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags MRC file format reader writer, structural biology image data, cryo-EM file I/O, volume data storage python, MRC2014 format support, numpy array file format, electron microscopy data, structural-biology, file-format, scientific-computing [View on SkillFed](https://skillfed.io/packages/mrcfile) · [View on PyPI](https://pypi.org/project/mrcfile/)