There are multiple approaches in Python.
My suggestion would be to use a cheminformatics library like Open Babel or RDKit to convert from SMILES (for example) to 3D coordinates.
If you want to grab from chemical databases, I can suggest two approaches:
- CIRPy - Uses the NIH chemical resolver to convert from names, SMILES, etc. into 3D structures.
- Webel - This is a web-based cheminformatics tool. I've used it in the past, but I'm not sure if it's still maintained.
There are other databases, including my PQR and PubChemQC that offer QM-optimized geometries.
The catch with databases is that you might want the geometry of a molecule that's not in the database. In that case, Open Babel or RDKit is a better solution.
One other caveat. Nothing I've indicated above does a very good job with metal-containing species. If you want ferrocene, that's a trickier problem with current solutions.