Welcome to endf-parserpy’s documentation!

endf-parserpy is a Python package for reading and writing ENDF files. This functionality in combination with Python’s powerful facilities for data handling enables you to perform various actions on ENDF files, such as:

  • Easily access any information

  • Modify, delete and insert data

  • Perform format validation

  • Convert from and to other file formats, such as JSON

  • Merge data from various ENDF-6 files into a single one

  • Read and write files that bundle several materials

  • Compare ENDF-6 files with meaningful reporting on differences

  • Construct ENDF-6 files from scratch

Many of these actions can be performed via the command line. The support for the ENDF-6 format is comprehensive and some special NJOY output formats are also supported. The package has been tested on the various sublibraries of the major nuclear data libraries, such as ENDF/B, JEFF, and JENDL. Files that bundle several materials, including PENDF tapes, are supported as well; see the guide on multi-material files.

Install endf-parserpy

python -m pip install endf-parserpy --upgrade

Note

Accelerated parsing relies on compiled C++ code. If a suitable binary wheel isn’t available for your platform, an attempt will be made to compile the C++ source files during installation, which can take up to ten minutes. The default optimization level aims to strike a balance between compile time and parsing speed. Power users can alter the optimization flag by setting the INSTALL_ENDF_PARSERPY_CPP_OPTIM environment variable before installation. For instance, under Linux and macOS, where the default compiler is GNU C++, you could disable all optimizations by:

export INSTALL_ENDF_PARSERPY_CPP_OPTIM="-O0"

Under Windows (assuming Microsoft Visual C++), you can do:

set INSTALL_ENDF_PARSERPY_CPP_OPTIM="/Od"

If you want to disable the compilation of the C++ modules entirely, you can set the environment variable INSTALL_ENDF_PARSERPY_CPP to no before executing the pip install command.

Note

The multi-material file interface indexes tapes with a structural scan that is faster when NumPy is available. To install this optional dependency, add the fast extra:

python -m pip install "endf-parserpy[fast]"

Without NumPy a pure-Python fallback is used, so the dependency is not required.

Note

The package is still evolving and will be extended with convenience functions to enhance the user experience. You can always check for updated versions on PyPI.

Resources