Adapt extraction script from teampy.