As far as I know, pdb requires you to supply the cell size, but xyz doesn't have such a requirement. Also, there is other info present in a pdb not present in an xyz. Do you have a strategy for handling this?
If so we could probably modify a cif to pdb creator I wrote using ASE.
Rob
from pdbparser import pdbparser
PDBS = {}
templatePDB = pdbparser(filePath='dummy_pdb_file_with_the_correct_atoms')for path in xyzFiles:
# this function returns a numpy array of the xyz coordinates
coords = read_xyz_file_coordinates(path')
pdb = templatePDB.get_copy()
pdb.set_coordinates(coords)
PDBS[path] = pdb