Generating geometries for substituted molecules I would like to automate some of my calculations, and I am looking for a tool to generate reasonable good initial geometries.

The details: I have already optimized molecular geometries, and I would like to perform calculations of several different substituted version of the molecule. Because of the size of the system, it would make sense to keep the already optimized geometry and exchange e.g. selected -H atoms to some R1, R2 groups. Is there any library that can manipulate 3D geometries this way?

I am aware I can do similar things with much graphical software (GausView etc).  However, the point would be automation: a command line tool or a library or something similar that I can call from Python scripts, instead of me clicking things on a screen one by one. 

I am also aware that I can generate 3D geometry from 2D or such. However, I would like to keep the already optimized main part of the molecule (it can be pretty big), for more efficient calculations, and insert new groups. I appreaciate any help, thanks.
For most of the geometry creation/manipulation I do, I use the Atomic Simulation Environment (ASE) - all in python.

It's pretty straightforward to use and has a gui so you can make sure you're doing the right thing as you go along. In particular, I'd recommend playing with it in a jupyter notebook. 

Checkout https://wiki.fysik.dtu.dk/ase/tutorials/manipulating_atoms.html for some examples. 

The ASE also has a dataset of existing molecules that you can import and add to your structure in various places.