I don't have an existing script to do this, but here is a sketch of how you might go about it.
from ccdc import io, descriptors
directory = '/path/to/directory/of/cifs'
cif_files = glob.glob(os.path.join(directory, '*.cif'))
for cif_file in cif_files:
with io.MoleculeReader(cif_file) as rdr:
cif = rdr
for a1 in cif.atoms:
for a2 in cif.atoms:
print a1.label, a2.label, descriptors.MolecularDescriptors.atom_distance(a1, a2)
It is worth noting that if you use an EntryReader to read the CIF file, all of the CIF attributes are available, for example,
cif_entry = io.EntryReader(cif_file)
a1 = cif_entry.attributes['_geom_bond_atom_site_label_1']
a2 = cif_entry.attributes['_geom_bond_atom_site_label_2']
length = cif_entry.attributes['_geom_bond_distance']
for a1, a2, length in zip(a1, a2, length):
print a1, a2, length
Hope this is helpful. Please come back with any questions you have about this, or indeed any other API matter.