How to create component to create simple custom objects using Polyline geometry and Key :value data attached using GHPython

Hello, I am new to Grasshopper and Python and have been given a task to complete. Can you please help me achieve it!

Thanks

Capture|690x344