MOFUN is a Python package that can find and replace patterns in a molecular structure, across periodic boundaries.
Requires Python > 3.8.
pip install mofun
mofun {input-structure} {output-structure} -f {find-pattern} -r {replace-pattern}
See Documentation
This software is described in an upcomining paper, which will be listed here once it is published.
The exact version of the software desribed in the paper is here: