Registry / data / parsnip-cif

parsnip-cif

JSON →
library0.6.1pypypi✓ verified 84d ago

Minimal library for parsing CIF and mmCIF files in Python. Version 0.5.0, released January 2026. Maintained by the Glotzer Lab. Active development with frequent minor releases.

pip install parsnip-cif
INSTALL
IMPORT
SIG · PARSNIP-CIF
P
parsnip-cif
datapythonv0.6.1
Install
3.8s avg
Import
360ms
Disk
90MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.362s · 90.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.8s · import 0.358s · 87MB
90MB installed
● package 90MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CifFile
from parsnip import CifFile
from parsnip_cif import CifFile
The package installs as 'parsnip-cif', but import uses 'parsnip' as the module name.

Basic parsing of CIF data using CifFile.

from parsnip import CifFile # Parse from a string cif_text = """ data_test _cell_length_a 10.0 _cell_length_b 10.0 _cell_length_c 10.0 """ cif = CifFile(cif_text, source='string') print(cif.keys()) # ['_cell_length_a', '_cell_length_b', '_cell_length_c'] print(cif.get('_cell_length_a')) # '10.0' # Parse a file (using context manager) # with open('structure.cif', 'r') as f: # cif = CifFile(f)
Debug
Known issues
breakingIn version 0.2.0, the primary interface changed to CifFile object. Old code using lower-level parsers may break.
fix
Migrate to use CifFile class. See release notes for API changes.
affects: <0.2.0
gotchaImport module name is 'parsnip', not 'parsnip_cif'. The PyPI package is 'parsnip-cif' but Python import uses 'parsnip'.
fix
Use 'import parsnip' or 'from parsnip import CifFile'.
affects: all
gotchaWhen passing a string to CifFile, you must specify source='string' (or another valid source). Otherwise, it may try to open the string as a file path.
fix
Always provide source parameter when parsing from a string: CifFile(cif_text, source='string').
affects: >=0.4.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'parsnip_cif'
Attempting to import the module using the package name 'parsnip_cif' instead of the correct module name 'parsnip'.
fix
Replace 'import parsnip_cif' with 'import parsnip' or 'from parsnip import CifFile'.
FileNotFoundError: [Errno 2] No such file or directory: 'data_test\n_cell_length_a 10.0...'
Passing a raw CIF string directly to CifFile without specifying source='string' causes it to treat the string as a file path.
fix
Use CifFile(your_string, source='string') instead.
Upgrade
Version history
0.6.1latest on PyPI · released Jun 11, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
parsnip-cif — pip install parsnip-cif · libregistry