Download attachments and page content from Confluence

For a project there is a need to move all the attachments in Confluence, including the page content, in a remote repository.

Confluence offers different API and the XML-RPC API can be still used. The API do not allow to download all the attachments in once but only page by page therefore the need for this python script which:

  1. Creates a folder for each page which includes
    1. the html export of the page
    2. all the attachments of the page
  2. Once all the pages are saved, it moves all the folders in the same hierarchical structure of the space

You can find the code my GitHub repository:

Main inspiration came from: