igwn_ligolw.utils Package

Library of utility code for LIGO Light Weight XML applications.

Functions

sort_files_by_size(filenames[, verbose, reverse])

Return a list of the filenames sorted in order from smallest file to largest file (or largest to smallest if reverse is set to True).

local_path_from_url(url)

For URLs that point to locations in the local filesystem, extract and return the filesystem path of the object to which they point.

load_fileobj(fileobj[, compress, xmldoc, ...])

Parse the contents of the file object fileobj, and return the contents as a LIGO Light Weight document tree.

load_filename(filename[, verbose])

Parse the contents of the file identified by filename, and return the contents as a LIGO Light Weight document tree.

load_url(url[, verbose])

Parse the contents of file at the given URL and return the contents as a LIGO Light Weight document tree.

write_fileobj(xmldoc, fileobj[, compress, ...])

Writes the LIGO Light Weight document tree rooted at xmldoc to the given file object.

write_filename(xmldoc, filename[, verbose, ...])

Writes the LIGO Light Weight document tree rooted at xmldoc to the file name filename.

write_url(xmldoc, url, **kwargs)

Writes the LIGO Light Weight document tree rooted at xmldoc to the URL name url.

Sub-modules