LIGO_LW XML I/O (gwpy.io.ligolw)#

Basic utilities for reading/writing LIGO_LW-format XML files.

All specific unified input/output for class objects should be placed in an ‘io’ subdirectory of the containing directory for that class.

Functions#

build_content_handler(parent, filter_func)

Build a ContentHandler with a given filter.

default_content_handler()

Return a standard content handler to read LIGO_LW documents.

get_filtering_contenthandler(element)

Build a FilteringLIGOLWContentHandler to exclude this element.

get_ligolw_element(xmldoc)

Find an existing <LIGO_LW> element in this XML Document.

get_partial_contenthandler(element)

Build a PartialLIGOLWContentHandler to read only this element.

is_ligolw(origin, filepath, fileobj, *args, ...)

Identify a file object as LIGO_LW-format XML.

iter_tables(source)

Iterate over all tables in the given document(s).

list_tables(source)

List the names of all tables in this file(s).

open_xmldoc(fobj[, contenthandler])

Try and open an existing LIGO_LW-format file, or create a new Document.

read_ligolw(source[, contenthandler])

Read one or more LIGO_LW format files.

read_table(source[, tablename, columns, ...])

Read a Table from one or more LIGO_LW files.

to_table_type(val, cls, colname)

Cast a value to the correct type for inclusion in a LIGO_LW table.

write_tables(target, tables, *[, append, ...])

Write an LIGO_LW table to file.

write_tables_to_document(xmldoc, tables, *)

Write the given LIGO_LW table into a Document.