Skip to main content

easyXRD

We have developed a versatile X-ray diffraction (XRD) analysis tool that utilizes modern and open-source Python packages such as pyFAI, xarray, pymatgen, pybaselines,... for data processing/storage and interfaced to Jupyter notebooks powered with actively developed visualization packages such as ipywidgets, and matplotlib. It provides easy access to the Materials Project database which hosts thousands of crystal structures that can be used for phase identification - a critical part of XRD analysis - and utilizes GSAS-II suite for XRD refinements in a user-friendly and intuitive manner. Ultimate goal of this tool is to make X-ray diffraction analysis easy for users and help them to process, refine, store, and share their XRD data conveniently.

You can try the tutorial notebooks below on Google Colab:

01_basic.ipynb
02_intermediate.ipynb
03_advanced-part-1.ipynb
03_advanced-part-2.ipynb

.... more to come

In order to use easyXRD Python package, you need to have a Python environment that can be easily installed through Conda.

You can follow the instructions on this link: https://www.anaconda.com/docs/getting-started/miniconda/install

Examples of environment setup is shown below:

  • Linux Bash:
mkdir -p ~/.miniconda3

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/.miniconda3/miniconda.sh
bash ~/.miniconda3/miniconda.sh -b -u -p ~/.miniconda3
rm ~/.miniconda3/miniconda.sh

source ~/.miniconda3/bin/activate
conda init --all
  • Windows PowerShell (After installing, open the “Anaconda Powershell Prompt (miniconda3)”):
wget "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -outfile ".\.miniconda.exe"
Start-Process -FilePath ".\.miniconda.exe" -ArgumentList "/S" -Wait
del .\.miniconda.exe
  • macOS Bash (Apple Silicon):
mkdir -p ~/.miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/.miniconda3/miniconda.sh
bash ~/.miniconda3/miniconda.sh -b -u -p ~/.miniconda3
rm ~/miniconda3/miniconda.sh

source ~/.miniconda3/bin/activate
conda init --all
  • macOS Bash (Intel):
mkdir -p ~/.miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o ~/.miniconda3/miniconda.sh
bash ~/.miniconda3/miniconda.sh -b -u -p ~/.miniconda3
rm ~/.miniconda3/miniconda.sh

source ~/.miniconda3/bin/activate
conda init --all

Then we need to create a virtual environment as shown below:

conda create --name env_py3.14_np_2.4 -c conda-forge -y  python=3.14 numpy=2.4

Once the new virtual environment is created, we need to activate and install easyXRD and GSAS-II packages directly from GitHub.

conda activate env_py3.14_np_2.4

# for easyXRD
python -m pip install "easyXRD[notebook] @ git+https://github.com/MehmetTopsakal/easyXRD.git"



# for GSAS-II (or use the Python helper below)

# These worked nicely on my Ubuntu 26.04.1 LTS
python -m pip install meson-python ninja wheel Cython pyproject-metadata tomli
NUMPY_PC_DIR="$(numpy-config --pkgconfigdir)"
export PKG_CONFIG_PATH="$NUMPY_PC_DIR${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
python -m pip install --no-build-isolation "GSAS-II[useful] @ git+https://github.com/AdvancedPhotonSource/GSAS-II.git"

# It was a bit painful to install GSAS-II inside conda environment. These worked for me on my virtual Windows 11.
python -m pip install meson-python ninja wheel Cython pyproject-metadata tomli
conda install -c conda-forge fortran-compiler c-compiler ninja meson-python cython numpy scipy wxpython lld llvm-tools m2w64-toolchain
python -m pip install --no-build-isolation "GSAS-II[useful] @ git+https://github.com/AdvancedPhotonSource/GSAS-II.git"
# if it fails in the previous line by complaining "Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/", do that and repeat previous line.

# Unfortunately I don't have and Arm Mac. 
# Try `python -m pip install --no-build-isolation "GSAS-II[useful] @ git+https://github.com/AdvancedPhotonSource/GSAS-II.git" `
# and ask AI on what to do if it fails :)

# 

Once easyXRD is installed, you can install GSAS-II from Python in the same environment (also works in a notebook):

import easyxrd

gsas_path = easyxrd.install_gsas2()
# Later, to update:
# easyxrd.install_gsas2(upgrade=True)

This installs build dependencies and the official GSAS-II GitHub package using the running Python interpreter, verifies its scripting import in a fresh process, and updates easyxrd.easyxrd_defaults["gsasii_lib_path"]. Restart Python or your notebook kernel afterward. Git and C/Fortran compilers must already be installed; the helper does not install operating-system packages. Use a dedicated conda or virtual environment with internet access.

GUI dependencies (including wxPython) are included by default because easyXRD's refinement setup requires wxPython. If you manage wxPython separately or only need GSAS-II scripting, use easyxrd.install_gsas2(gui=False). Building wxPython on Linux can take considerable time and require system development libraries. See the official pip installation instructions for platform prerequisites; the manual commands above are also available.

If all is successful, you should be able to import easyXRD inside python:

from easyxrd import exrd

After this step, you can contine with exrd as we explained in the Google Colab notebooks that are listed above.

Acknowledgements

Development of easyXRD was supported by FY24 Scientific Technique and Expertise Development – Instrument Scientist Support Project managed by Nuclear Science User Facilities (NSUF), https://nsuf.inl.gov/. If you find easyXRD useful for your research, please acknowldege using the sentence below:

"This work utilized easyXRD an open-source tool used for processing and analyzing X-ray diffrection data and is supported by the DOE, Office of Nuclear Energy, under DOE Idaho Operations Office Contract DE-AC07-05ID14517, as part of a Nuclear Science User Facilities project."

In addition, you need to acknowledge GSAS-II if you use the refinement components of easyXRD. You can check the original GSAS-II repo, https://github.com/AdvancedPhotonSource/GSAS-II, for further details.

Feel free to contact me (metokal@gmail[-remove-this].com) if you have any questions about easyXRD

Metadata

Release files for easyxrd 2026.10.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easyxrd 2026.10.12
File Size Uploaded
easyxrd-2026.10.12.tar.gz 71.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for easyxrd 2026.10.12
File Interpreter ABI Platform
easyxrd-2026.10.12-py3-none-any.whl Python 3 none any Details

Total release size: 126.4 kB

Release files / easyxrd-2026.10.12.tar.gz

Download URL easyxrd-2026.10.12.tar.gz
Size 71.5 kB
Tags Source
SHA-256 checksum
How to use checksums
323ee7117093d001ec62c5cd2f607fa11fe2372efd6ada0a3bb49015522cf985
BLAKE2b-256 checksum
How to use checksums
e6eeada794fbe83c5f03225f5cfd9a3f8ff24a35cfdf9f4a08b81de4de270749
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / easyxrd-2026.10.12-py3-none-any.whl

Download URL easyxrd-2026.10.12-py3-none-any.whl
Size 54.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c69925fce7080c861515a294ec6a1a53f888b29d585189d997de87658728d7f
BLAKE2b-256 checksum
How to use checksums
0d0a6c73a6e7e62ef8e8e0c62a55125cde3f16428017632daab8609f04fcb730
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

2026.10.12 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page