Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to amend a confluence page using python or other language automatically?

hansi hu July 18, 2019

Background

My responsibility is to maintain a table in a existing confluence page.

The table is manually copied from a table in an EXCEL generated by a python run weekly.

Expectation

Instead of copying the table manually, is there an automatic way we can apply to update the table in the confluence?

Possible Solution:

1) directly update the table in the confluence page using the variables of the python script.

2) Update the table in the confluence page using other language with the input of the csv.

 

1 answer

0 votes
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2019

You have two possible ways":

  • External script that writes to the page, but it has to write the entire page.
  • Use a script to attach a CSV to the page (or known location), and have a macro to generate a table from the CSV (there is a commercial plugin available or a great article on a user macro version).
hansi hu July 28, 2019

Thank for your answer.

  • External script that writes to the page, but it has to write the entire page

How to write a script to write the page? Is there an example of python script or any documentation?

  • Use a script to attach a CSV to the page.

Does the script works for excel? I want to generate a table on the confluence page from an Excel file and keep the format and color in the excel.

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2019

Yes, you will have to look at developer docs for in he REST/API. My team has used the following to make development easier:

https://github.com/rpcope1/PythonConfluenceAPI

If you want to work with Excel, then you could just write that file to the Confluence page, then use the Confluence view-file-macro. I am not sure how much of the formatting it preserves.

There is a commercial plugin that does offer more features: excel-for-confluence

Like hansi hu likes this
hansi hu July 30, 2019

Hi Bailey,

Thank for your answer and help.

However, It seems that PythonConfluenceAPI is a python 2 package.

Is there a python 3 package available?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events