You can load a curve from a CSV file that has this structure:
# Markups fiducial file version = 4.11
# CoordinateSystem = 0
# columns = id,x,y,z,ow,ox,oy,oz,vis,sel,lock,label,desc,associatedNodeID
1,-48.966353538964675,-101.7065776156342,74.67105263157896,0,0,0,1,1,1,0,MarkupsCurve-1,,
1,-53.75692521242794,-85.6239441404361,66.4605263157895,0,0,0,1,1,1,0,MarkupsCurve-2,,
1,-60.86814580722918,-72.76476934319273,60.7763157894737,0,0,0,1,1,1,0,MarkupsCurve-3,,
1,-65.87663276996875,-62.425437293974404,57.87936805530591,0,0,0,1,1,1,0,MarkupsCurve-4,,
1,-73.58132198684874,-44.72104505093102,57.37936805530591,0,0,0,1,1,1,0,MarkupsCurve-5,,
To load from Python, you can curveNode = slicer.util.loadMarkupsCurve('some/folder/MarkupsCurve.fcsv')
(this convenience function is available in Slicer Preview Release downloaded tomorrow or later).
I created a script for CPR earlier, but to make it more accessible, I’ve now added it as a module (“Curved Planar Reformat”) to SlicerSandbox extension. It is available for Slicer Preview Releases you download tomorrow or later (in Examples category).