I created a Confluence page some time ago, where there is one table. Periodically I need to add additional row and to put some text there. I would like to automate it. Besides, in the last column I need to upload some files.
I wrote a code that can get (download) table from Confluence page. But I am thinking, how to write new information in new row in that table in Confluence through Python. From research that I have carried out I decided that I need to update that table in Python (as dataframe) that I have got from Confluence. After that upload new table into Confluence. Is this idea correct?
I suppose that modified table (dataframe) in Python I need to put as
conf.update_page(page_id, page_content),
However, I get an error like "Object of type DataFrame is not JSON serializable". Could you help me, please? I do not know, how to solve it. Perhaps, something is incorrect.
As I have written before, I need to attach some documents to the last column of the table. I completely do not understand how to do it. There are some functions that can attach something to Confluence, but I need to attach files in the last column and the last (created) row. Do I need to do it in dataframe (modified table) in Python or should I do it in Confluence after uploading modified table there? If so, I do not understand, how to explain to Python to put it exactly in the last column as I only download table to Python from Confluence. Moreover, when
Below there is a code, by which I got table from Confluence.
<span>from</span> atlassian <span>import</span> Confluence
<span>import</span> pandas <span>as</span> pd
conf_site = <span>'https://confluence.company.com/'</span>
conf_user = <span>"login"</span>
conf_pass = <span>"password"</span>
page_id = <span>0000000000</span>
conf = Confluence(url=conf_site, username=conf_user, password=conf_pass)
page = conf.get_page_by_id(page_id, expand=<span>'body.view'</span>)
page_content = page[<span>'body'</span>][<span>'view'</span>][<span>'value'</span>]
table = pd.read_html(page_content)
table = table[<span>0</span>]This table was open in Python as dataframe and I created new row in it and put essential information. However, I do not comprehend, how to add it to Confluence page. I got an error written above.
Thank you in advance!