I don't like this, modifying a list while iterating over it is generally not a good idea and can lead to unexpected behaviour. You could do something like:

    if pkg_dict.get('resources'):
        pkg_dict['resources'] = [r for r in pkg_dict['resources'] if not r['id'] == id]