xylib is a portable library for reading files that contain x-y data from powder diffraction, spectroscopy and other experimental methods.

It comes with two programs that can convert supported formats to plain text: command-line xyconv and graphical xyconvert.

Supported formats:

Examples of supported files are collected in sample-urls.


The library is written in C++ and has C bindings. It has SWIG-generated bindings for Python (pip-installable, see below). To use it from other languages -- either also use SWIG or access C API through FFI (here is an example).

The API is documented in the xylib/xylib.h file. Adding new formats -- in README.dev.

Licence: LGPL

xylib is used by:


Converts a file from one of the supported formats to plain text:

xyconv myfile.bin plain.txt

It has a few options, see xyconv -h for details.



The GUI is designed for quick converting of many files at once.


Binary packages:


To compile the source code you need:

Two build systems are provided: either use CMake or, on Unix, ./configure && make. To skip building the GUI use option -D GUI=OFF for CMake or --without-gui for configure. If you are using git, autoreconf -i is needed before ./configure.

It also has setup.py to build the library with its Python bindings, and it is upload to PyPI. If you have SWIG, Boost headers and C++ compilers installed, it may be enough to just type:

pip install xylib-py --user

If the Boost headers cannot be found, run pip with options --global-option=build_ext --global-option=-I/path/to/boost_1_60_0. See the xyconv.py file for usage examples.



Feel free to send e-mail to the authors, or to the fityk-dev mailing list.