The ihm.format_bcif Python module

Utility classes to handle BinaryCIF format.

See https://github.com/dsehnal/BinaryCIF 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.

category(category)[source]

See ihm.format.CifWriter.category().

loop(category, keys)[source]

See ihm.format.CifWriter.loop().

start_block(name)[source]

See ihm.format.CifWriter.start_block().

write_comment(comment)[source]

See ihm.format.CifWriter.write_comment().

Note

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_file()[source]

Read the file and extract data.

Returns:

True iff more data blocks are available to be read.