Extract autodocked protein-ligand connections programatically
With pymol as a python module (conda install -c schrodinger pymol, not the GUI one), it is very easy.

import pymol2
with pymol2.PyMOL() as pymol:
     pymol.cmd.load('protein.pdbqt', 'protein') # the second is the name within pymol instance.
     pymol.cmd.load('ligand.sdf', 'ligand')
     pymol.cmd.save('neighbours.pdb','ligand expand 3') # get atoms 3 Å around


Done!
However, if you are doing stuff in python in the first place you might want the last line as a string: pymol.cmd.get_pdbstr('ligand expand 3'). Changing the selection 'ligand expand 3' to 'byres ligand expand 3' will save the full residues.

Alternatively you can get the atom coordinates themselves etc. with it. To see what attributes Atom has you have you can do this:

for atom in pymol.cmd.get_model('ligand expand 3').atom:
    print(dir(atom))
    break


Which will give a large amount of attributes, such as atom.coord, which is a 3-element list.