IGWN LIGO Light-Weight XML I/O Library
raw JSON → 2.1.1 verified Mon Apr 27 auth: no python
A Python library for reading, writing, and manipulating LIGO Light-Weight XML (LIGO_LW) documents. Version 2.1.1 requires Python >=3.9. Development is active on GitHub.
pip install igwn-ligolw Common errors
error ImportError: No module named 'ligolw' ↓
cause The package was renamed and the old name is not backwards compatible.
fix
Install igwn-ligolw: pip install igwn-ligolw
error ImportError: libxml2.so.2: cannot open shared object file ↓
cause Missing libxml2 runtime library.
fix
Install libxml2: sudo apt-get install libxml2 (or equivalent for your OS)
Warnings
breaking The package was renamed from 'python-ligo-lw' to 'igwn-ligolw'. Old installations will not update automatically. ↓
fix Uninstall the old package and install igwn-ligolw.
deprecated The top-level module 'ligolw' is used; do not import from 'igwn.ligolw'. ↓
fix Use 'import ligolw' directly.
gotcha The library relies on external dependencies like 'libxml2' for some features. Missing system libraries can cause import errors. ↓
fix Install system dependencies: sudo apt-get install libxml2-dev libxslt1-dev (Linux) or use conda.
Imports
- ligolw wrong
from igwn import ligolwcorrectimport ligolw - lsctables wrong
from igwn.ligolw import lsctablescorrectfrom ligolw import lsctables
Quickstart
import ligolw
from ligolw import utils
load_doc = utils.load_filename('test.xml', contenthandler=ligolw.LIGOLWContentHandler)
print(load_doc)