Source code for boltz_data.cif._write
from pathlib import Path
import gemmi
from smart_open import open as smart_open # type: ignore[import-untyped]
[docs]
def write_cif(path: str | Path, /, *, contents: gemmi.cif.Document | gemmi.cif.Block) -> None:
"""Write a CIF document or block to a file."""
with smart_open(str(path), "w") as f:
f.write(contents.as_string())