The package for reading mcnp input in a pythonic way
MCNP Input Reader is a python package developed in ENEA to help the modifications and the check integrity of large mcnp input files.
pip install mcnp-input-reader
import mcnp_input_reader as mir
mcnp_input = mir.read_file('input.i')
mcnp_input.cells # return the table of cells
mcnp_input.cells.filter(lambda cell: cell.material_id == 2) # return the cells using material M2
A lot of things...
Example taken from here