Skip to content

Formats

Lenz Furrer edited this page May 24, 2021 · 15 revisions

Formats

Format-specific Options

Most input and output formats accept some options to control details of parsing and serialisation. The options are given as keyword arguments to the top-level functions (bconv.load/dump etc.) or passed directly to the loader/exporter constructor. The available options are described in the individual format documentation:

For every format, there is a table of parameters, listing their name, type, default value and purpose. Some options are shared by multiple loaders/exporters, most notably the entity-flattening parameters, which are common to all exporters with entity annotations. If necessary, more details about each parameter is given in a Notes section.

Format Properties

In addition, a short table with key-value pairs summarises some important properties of every format. For all formats, this table states whether text and/or annotations can be represented. This is vital information especially for choosing the right output format, in order to determine if all desired content can be exported. The stream type property denotes how to open files (text or binary mode) when providing a file-like object to bconv.load/dump. For input documents, the native type and lazy loading properties are related to the mode parameter of bconv.load/fetch. The first one defines whether mode="native" returns a Document or Collection object. The second one reveals if mode="lazy" actually has a memory-saving effect.

Clone this wiki locally