It would be nice to do this in a pure Python implementation, because as far as I know there are no good Python converters for DICOM-RT currently available. The other option is to use an external package such as plastimatch which has a good handle on such conversions.
Additional code will likely have to be added for data conversion in pipelines, as DICOM-RT data cannot be converted to e.g. NIFTI format without accompanying volumetric DICOMs to set orientation and spatial data.