Utilities

exporter.util.quote_list(it)[source]

Wrap each element in single quotation marks and return as a comma-separated string.

Parameters:

it (Dict[str, Any] | List[str] | Set[str]) – an iterable

Return type:

str

exporter.util.sample_and_format(population, arguments)[source]

Call random.sample(), bounding the sample size in arguments["max"] to the population size.

If arguments["mode"] is “oneLine”, return the sample as a comma-separated string.

Otherwise, return the sample as a paragraph list.

Parameters:
  • population – the population to sample

  • arguments (Dict[str, Any]) – the tag’s arguments

Return type:

str | List[Element]

exporter.util.box_image(tag, function, filename, *args, **kwargs)[source]

Add an image to the OpenDocument file and return an image within a frame.

Parameters:

filename (str)

Return type:

Element