python-esppy icon indicating copy to clipboard operation
python-esppy copied to clipboard

Add ways to send data to a publisher

Open kesmit13 opened this issue 6 years ago • 2 comments

Right now, when sending data to a publisher, it's all done though CSV strings which each have to be terminated by a newline. It would be nice if it would accept Python lists and DataFrames objects. They could then be converted to CSV and sent in the background.

pub.send([['1', '2', '3'],
          ['4', '5', '6']])

df = pd.DataFrame([['1', '2', '3'],
                   ['4', '5', '6']])
pub.send(df)

Having a send_line method in addition to send, which adds the newline character would also be a good addition.

Rather than:

pub.send('1,2,3\n')

You could do:

pub.send_line('1,2,3')

kesmit13 avatar Oct 11 '18 14:10 kesmit13