Plotting 3d line segments in Plotly

I am trying to plot a bunch of 3d line segments using Plotly in python. The only 2d way I have found till now is of using the Layout options in the 3dScatter function, as described here: https://plot.ly/python/shapes/

Are there any options available in 3d? Even in 2d, is there an easier way of plotting line segments. Like Matplotlib’s amazing LineCollection, which plots a bunch of lines in a flash.