--- id: xraydb version: "4.5.8" license: MIT license_treatment: permissive maintenance: active --- # xraydb — calculations with XrayDB: reference data for X-ray interactions with matter License: permissive · Maintenance: active · Downloads: 73.7K/mo ## What it is and what it does XrayDB is a Python library that wraps a SQLite database of X-ray reference data—absorption coefficients, scattering factors, fluorescence yields, and other physical properties—compiled from sources including the Elam Tables and refined anomalous scattering data. It lets you query X-ray properties of elements and compounds programmatically, supporting calculations in X-ray spectroscopy, diffraction, and absorption studies. The package depends on numpy, scipy, sqlalchemy, and platformdirs, making it a lightweight addition to a scientific Python stack. It targets researchers and engineers working in materials science, synchrotron beamline software, and X-ray physics who need reliable reference data without building their own database. Use it for: - Calculate mass absorption coefficients for X-ray absorption spectroscopy (XAS) data reduction. - Look up anomalous scattering factors for X-ray crystallography structure refinement. - Query fluorescence yields and line energies for X-ray fluorescence (XRF) analysis. - Build element-property tables for synchrotron beamline control and data processing software. - Validate X-ray interaction models in simulation and modeling workflows. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. XrayDB provides a Python interface to a SQLite database of X-ray reference data, enabling calculations and lookups of X-ray interactions with matter for physics and materials science applications. Yes. XrayDB is production-stable, actively maintained, carries no known vulnerabilities, and installs with low friction. If you work with X-ray data or need reliable reference properties for X-ray physics calculations, it is a solid choice. The MIT license and Public Domain data pose no restrictions. ## Install pip install xraydb uv add xraydb poetry add xraydb ## Installing xraydb Before you install: Low friction installation with a pure-Python wheel. Maintenance is active with recent commits and stable production status across modern Python versions (3.9–3.13, including PyPy). License in practice: MIT license is permissive; you can use, modify, and distribute the package with minimal restrictions. The underlying data is in the Public Domain. Quickstart: pip install xraydb import xraydb db = xraydb.XrayDB() mu = db.mu_chantler('Fe', 10.0) # mass absorption coefficient for Fe at 10 keV Verify before relying: - Whether the SQLite database is downloaded automatically on first use or requires manual setup. - Performance characteristics for large-scale queries or real-time applications. - Completeness and accuracy of anomalous scattering factors relative to published literature. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 73.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags x-ray reference data, x-ray absorption calculations, x-ray scattering factors, x-ray physics database, anomalous scattering data, x-ray element properties, x-ray matter interactions, x-ray-physics, reference-data, materials-science [View on SkillFed](https://skillfed.io/packages/xraydb) · [View on PyPI](https://pypi.org/project/xraydb/)