Convert the atoms structure to a CP2K input file skeleton string

def get_cp2k_structure(atoms):
    """Convert the atoms structure to a CP2K input file skeleton string"""

    from cp2k_tools.generator import dict2cp2k

    # CP2K's default unit is angstrom, convert it, but still declare it explictly:
    cp2k_cell = {sym: ('[angstrom]',) + tuple(coords) for sym, coords in zip(('a', 'b', 'c'), atoms.get_cell()*Bohr)}
    cp2k_cell['periodic'] = 'XYZ'  # anything else does not make much sense
    cp2k_coord = {
        'scaled': True,
        '*': [[sym] + list(coord) for sym, coord in zip(atoms.get_chemical_symbols(), atoms.get_scaled_positions())],
        }

    return dict2cp2k(
        {
            'global': {
                'run_type': 'ENERGY_FORCE',
                },
            'force_eval': {
                'subsys': {
                    'cell': cp2k_cell,
                    'coord': cp2k_coord,
                    },
                'print': {
                    'forces': {
                        'filename': 'forces',
                        },
                    },
                },
            }
        )