The ihm.format_bcif Python module

Utility classes to handle BinaryCIF format.

See for a description of the BinaryCIF file format.

This module provides classes to read in and write out BinaryCIF files. It is only concerned with handling syntactically correct BinaryCIF - it does not know the set of tables or the mapping to ihm objects. For that, see ihm.reader.

class ihm.format_bcif.BinaryCifWriter(fh)[source]

Write information to a BinaryCIF file. See ihm.format.CifWriter for more information. The constructor takes a single argument - a Python filelike object, open for writing in binary mode.


See ihm.format.CifWriter.category().

loop(category, keys)[source]

See ihm.format.CifWriter.loop().


See ihm.format.CifWriter.start_block().


See ihm.format.CifWriter.write_comment().


BinaryCIF does not support comments, so this is a noop.

class ihm.format_bcif.BinaryCifReader(fh, category_handler, unknown_category_handler=None, unknown_keyword_handler=None)[source]

Class to read a BinaryCIF file and extract some or all of its data.

Use read_file() to actually read the file. See ihm.format.CifReader for a description of the parameters.


Read the file and extract data.

Returns:True iff more data blocks are available to be read.