If you want to embed this tool into your own script, you can do so with the following API.
The following example shows how to compile a SystemRDL file and then generate the C header using the Python API.
from systemrdl import RDLCompiler
from peakrdl_cheader.exporter import CHeaderExporter
# compile the SystemRDL
rdlc = RDLCompiler()
rdlc.compile_file('example.rdl')
top = rdlc.elaborate()
# generate the C header
exporter = CHeaderExporter()
exporter.export(node=top, path='out.h')
peakrdl_cheader.exporter.CHeaderExporter