Currently, we can use MainWindow in custom code but the class only support empty or file_name argument. I looked through the code briefly and thought it would not be too hard to add supporting for a SMILES string or even better a rdkit Mol object as an argument.
Do you already have a plan to support that? If not I can help if you think it is useful.