endf
A recipe-driven toolkit for reading, writing, and modifying ENDF-6 nuclear data files in Rust.
Based on the formal ENDF grammar from endf-parserpy, this crate uses a set of ENDF recipes (format descriptions) to parse any MF/MT section into structured data and write it back to valid ENDF-6 format.
Quick Start
use EndfParser;
use Path;
let parser = new?;
let data = parser.parse_file?;
// Access MF=3, MT=1, variable "QM"
if let Some = data.get_path
// Modify and write back
let mut data = data;
data.set_path;
let output = parser.write?;
write?;
Features
- Recipe-driven -- parses and writes ENDF-6 files using a formal grammar, supporting five recipe formats: endf6, endf6-ext, jendl, pendf, errorr
- Roundtrip support -- parse, modify values, and write back to valid ENDF-6 format
- JSON conversion -- convert between ENDF and JSON representations
- Parallel parsing -- optional multi-threaded section parsing via rayon
(enabled by default, disable with
default-features = falsefor WASM) - No unsafe code
Recipe Formats
| Format | Description |
|---|---|
endf6 |
Standard ENDF-6 (default) |
endf6-ext |
Extended ENDF-6 with obsolete LVT support |
jendl |
JENDL-specific MF8/MT457 handling |
pendf |
Pointwise ENDF (NJOY output) |
errorr |
ERRORR covariance format (NJOY output) |
let parser = builder
.endf_format
.ignore_send_records
.build?;