Running context.io Python scripts in KNIME

I'm new to Python.  I would like to run Context.io 's Python script in KNIME to import IMAP email into a database.  I have loaded the required dependencies according to the Github directions.

https://github.com/contextio/Python-ContextIO

The Github directions state that

"You first need to instantiate the main ContextIO object with your API credentials:

import contextio as c

CONSUMER_KEY = 'YOUR_API_KEY'
CONSUMER_SECRET = 'YOUR_API_SECRET'

context_io = c.ContextIO(
    consumer_key=CONSUMER_KEY,
    consumer_secret=CONSUMER_SECRET
)

Do I accomplish this using node type Python Object Writer,  Python Source, Python Script, or something else?

Thank you

import contextio as c

CONSUMER_KEY = 'YOUR_API_KEY'
CONSUMER_SECRET = 'YOUR_API_SECRET'

context_io = c.ContextIO(
    consumer_key=CONSUMER_KEY,
    consumer_secret=CONSUMER_SECRET
)
import contextio as c

CONSUMER_KEY = 'YOUR_API_KEY'
CONSUMER_SECRET = 'YOUR_API_SECRET'

context_io = c.ContextIO(
    consumer_key=CONSUMER_KEY,
    consumer_secret=CONSUMER_SECRET
)

Hi,

if I understand you correctly you want to use Context.IO to load a list of IMAP accounts into KNIME, right?

In this case you would use a Python Source node, because you have no input table but want to get an output table with the accounts back. Once you have retrieved a list of accounts you have to put them into a pandas.DataFrame called output_table. This object will then automatically be converted back into a KNIME table.

Cheers, Patrick