Glassure provides tools for extracting structural information from total X-ray scattering data from glasses, liquids, and other disordered materials. Its workflows include background subtraction, normalization, structure factors, Fourier transforms, and pair distribution functions.
The library and the browser interface
The Python library supports scripted analysis and notebooks. Glassure 3 includes its Rust numerical core in the standard installation while retaining the public Python imports, pattern arrays, configuration objects, and result objects. NumPy and Pydantic are the only mandatory direct Python runtime dependencies.
Glassure Web provides an experimental interactive interface for loading data, configuring an analysis, and visualising the results in a browser. It is a separate application: its release cycle and available features need not match the Python package.
The numerical core also has a standalone Rust API, which can be used without Python.
Install or upgrade
python -m pip install --upgrade glassure
The stable Glassure 3 release provides wheels for Python 3.10–3.13 on Linux x86-64, Windows x86-64, and macOS on Intel and Apple silicon. Matching wheels need no Rust compiler. Source builds require Rust 1.93 or newer and a platform C linker.
For the independent Python reference backend and the optional lmfit, pandas, SciPy, and xraylib interfaces:
python -m pip install --upgrade 'glassure[legacy]'
Installing the legacy extra leaves the bundled Rust backend selected by default. Select backend="python" explicitly when using the reference implementation.
Start an analysis
from glassure.pattern import Pattern
from glassure.calc import create_calculate_pdf_configs, calculate_pdf
data = Pattern.from_file("sample.xy")
background = Pattern.from_file("background.xy")
data_config, calculation_config = create_calculate_pdf_configs(
data=data,
bkg=background,
composition="SiO2",
density=2.2,
)
result = calculate_pdf(data_config, calculation_config)
result.sq.save("structure-factor.xy")
result.gr.save("pair-distribution.xy")
The documentation includes examples and the API reference. Density-fit standard errors are conditional on the chosen model and processing assumptions; they do not include every source of experimental or model uncertainty.
Moving from an earlier release
Glassure 3 corrects Gaussian pair weighting and polynomial structure-factor optimization. Affected results can differ from Glassure 2, including when using the Python reference backend. The migration guide explains the numerical changes, backend selection, and optional legacy interfaces.
For release notes, citation information, and support, use the project repository and issue tracker.