Hi,
The easiest way is to transpose your existing flatfile data into the format of the ESM (URL) format flatfile parser in the demo files, that is, to take the data you have and assign it to the corresponding columns in the ESM URL format flatfile. Then, you can use the same parser as provided in the demo script for computing residuals with your own dataset. If you are familiar with object-oriented programming in python, you can of course use one of the existing parsers as a template for creating one for your own dataset (although the first approach is likely the most practical).
To perform a residual analysis in the SMT you need the following information at a minimum within your flatfile: 1) the source information such as magnitude, hypocentre location and also strike, dip and rake if available, 2) station information such as station location and vs30 and 3) the ground-shaking intensity measure levels recorded by the stations for these earthquakes for the intensity measure types (IMTs) you wish to compute ground-motion residuals with your selected GMMs (the GMMs and the IMTs to compute residuals for are specified within the TOML configuration file, as can be seen in the residual analysis demo files).
I hope this information is of use to you.
Thanks,
Christopher
GEM Hazard Team Modeler