Glassure
A Python API for data analysis of total x-ray diffraction data. It performs background subtraction, Fourier transform and optimization of experimental data.
Warning, the upgrade from version 1.4.5 to 2.0.0 has removed the GUI - which came with glassure. A new WebGUI based on the version 2 API is available under glassure.vercel.app.
Documentation
The documentation can be found here.
Changelog
The changelog can be found here.
Maintainer
Clemens Prescher (clemens.prescher@gmail.com)
Requirements
- python 3.10+
It is known to run on Windows, Mac OS X and Linux.
Installation
The Glassure package can be installed into your existing python distribution using pypi via:
python -m pip install glassure
Quick Start
Check out the examples directory for complete working examples:
1. Quick Start ⭐
from glassure.pattern import Pattern
from glassure.calc import create_calculate_pdf_configs, calculate_pdf
# Load your data
data = Pattern.from_file("sample.xy")
bkg = Pattern.from_file("background.xy")
# Create configs with defaults - just provide the essentials!
data_config, calculation_config = create_calculate_pdf_configs(
data=data,
composition="SiO2", # or {"Si": 1, "O": 2}
density=2.2, # g/cm³
bkg=bkg,
)
# Calculate PDF
result = calculate_pdf(data_config, calculation_config)
# Access results: S(Q), F(r), g(r)
result.sq.save("sq.xy")
result.fr.save("fr.xy")
result.gr.save("gr.xy")
2. Configuration System (For production)
For more control, use the configuration system with SampleConfig, TransformConfig, and CalculationConfig.
3. Raw Functions (For research/debugging)
For maximum control, use the low-level functions directly.
See the examples directory for complete, documented examples of all three approaches.
Example Datasets
The repository includes test datasets in tests/data/:
SiO2.xy- SiO2 (silica) X-ray scattering patternSiO2_bkg.xy- Background pattern
Use these with the example scripts to get started!
Metadata
Release files for glassure 2.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| glassure-2.4.0.tar.gz | 78.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| glassure-2.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 189.7 kB
Release files / glassure-2.4.0.tar.gz
| Download URL | glassure-2.4.0.tar.gz |
|---|---|
| Size | 78.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9fd2e50d68831f8c46608a7dd44a8d6c1b0d861ead602c5cc4aaa94d4ed2ac0
|
|
BLAKE2b-256 checksum How to use checksums |
fa15837a0cbf830bdfb8254fa2f8ed59dd02f2a81807a2095084874bd3477741
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / glassure-2.4.0-py3-none-any.whl
| Download URL | glassure-2.4.0-py3-none-any.whl |
|---|---|
| Size | 111.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
79910223b952ad6f8f3ddac3b95b4ead4faf09d351fd4b8d0fb540559d3ac663
|
|
BLAKE2b-256 checksum How to use checksums |
d81971155268c7574a3c77523eb32c5efc9d4c7c992ecbcb93fc3c41ccfaf088
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency log