write_tables#

gwpy.io.ligolw.write_tables(
target: Writable | Document,
tables: Iterable[Table],
*,
append: bool = False,
overwrite: bool = False,
contenthandler: type[ContentHandler] | None = None,
**kwargs,
) None[source]#

Write an LIGO_LW table to file.

Parameters:
targetstr, file, Document

the file or document to write into

tableslist, tuple of Table

the tables to write

appendbool, optional, default: False

if True, append to an existing file/table, otherwise overwrite

overwritebool, optional, default: False

if True, delete an existing instance of the table type, otherwise append new rows

contenthandlerContentHandler, optional

the content handler with which to parse the document, if not given a default handler will be created using default_content_handler().

**kwargs

other keyword arguments to pass to load_fileobj() as appropriate