Assemble robots via Python code

I have seen several posts that tried to attach an arm to a mobile robot like the transporter. For my project, I would like to select and assemble arms with mobile robots flexibily. Is there any way to assemble robots via Python code rather than doing it manually in GUI?