Metadata-Version: 2.4
Name: XRetriever
Version: 0.1.0
Summary: X-ray Diffraction Pattern Matching and Crystal Structure Retrieval
Home-page: https://github.com/Bin-Cao/XRetriever
Author: Bin Cao
Author-email: bcao686@connect.hkust-gz.edu.cn
License: MIT
Project-URL: Bug Reports, https://github.com/Bin-Cao/XRetriever/issues
Project-URL: Source, https://github.com/Bin-Cao/XRetriever
Project-URL: Documentation, https://github.com/Bin-Cao/XRetriever#readme
Keywords: xrd x-ray diffraction crystallography materials science pattern matching phase identification crystal structure materials characterization powder diffraction peak detection
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Natural Language :: English
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.19.0
Requires-Dist: scipy>=1.5.0
Requires-Dist: pandas>=1.1.0
Requires-Dist: matplotlib>=3.3.0
Requires-Dist: tqdm>=4.50.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0.0; extra == "dev"
Requires-Dist: pytest-cov>=2.10.0; extra == "dev"
Requires-Dist: black>=20.8b1; extra == "dev"
Requires-Dist: flake8>=3.8.0; extra == "dev"
Requires-Dist: sphinx>=3.2.0; extra == "dev"
Provides-Extra: database
Requires-Dist: ase>=3.20.0; extra == "database"
Requires-Dist: pymatgen>=2022.0.0; extra == "database"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# XRetriever




**XRetriever** is a powerful Python package for X-ray Diffraction (XRD) pattern matching and crystal structure retrieval. It provides state-of-the-art algorithms for matching experimental XRD patterns to crystal structure databases, enabling rapid phase identification and materials characterization.



### Core Capabilities
- **Robust Peak Detection**: Advanced algorithms with Savitzky-Golay filtering and baseline removal
- **Intelligent Pattern Matching**: Hungarian algorithm-based optimal peak assignment
- **Dual Scoring Metrics**:
  - **Weighted Score**: 70% position + 30% intensity similarity
  - **FOM (Figure of Merit)**: ICDD-standard quantitative matching metric
- **Element-Based Filtering**: Fast candidate screening by chemical composition
- **Flexible Input**: Support for CSV, TXT, and direct peak data input

### Advanced Features
- **Combined Scoring Mode**: Get both weighted and FOM scores simultaneously
- **Top-N Peak Selection**: Automatically extract and normalize the strongest peaks
- **Configurable Tolerances**: Adjust position tolerance (default: ±0.2° in 2θ)
- **Comprehensive Results**: Detailed matching information with peak-by-peak analysis

## Installation

### From PyPI (Recommended)
```bash
pip install XRetriever
```


