Retrieve ID ligand from PDB file I have thousands of PDB files and I need to extract the following information from each of them: an ID or the name of the small molecule (ligand) present in the complex.

Is there a way to do that with BioPython or similar tools? Taking this PDB entry as an example, the tools should return 7FM.
I found out that the package PyPDB has the function get_ligands that does exactly what I'm looking for.