Skip to main content

Export Confluence page and convert to others formats

Project description

Confluence exporter

Lint Unit tests

Table of Contents

Overview

Confluence exporter is a module and a script used to export pages from Confluence. All the pages exported are merged in one document.

Currently, only the Pdf exporter is fully functional but it is planned to support others formats like :

  • Word
  • Markdown

Installation

From PyPI (Recommended)

You can install the exporter easily with the following command or insert into your requirements file :

pip install confluence-exporter

From sources

It is recommended to use a virtual environment :

python -m venv venv

To install the module and the main script, simply do :

pip install .

For the developers, it is useful to install extra tools like :

These tools can be installed with the following command :

pip install .[dev]

The Git hooks can be installed with :

pre-commit install

The hooks can be run manually at any time :

pre-commit run --all-file

Usage

The script with required argument can be started by executing the following command :

./confluence-export my_config.yaml

The full list of arguments supported can be displayed with the following helper :

./confluence-export.exe -h
usage: confluence-export [-h] [-v] [config.yaml]

positional arguments:
  config.yaml    Configuration file

options:
  -h, --help     show this help message and exit
  -v, --verbose  Verbose mode

Configuration

The configuration file support 2 formats :

In Yaml :

Server:
  Confluence: "https://my.confluence.server.com"
Pages to export:
  <Space Key 1>: "Page title 1"
  <Space Key 2>:
    - "Page title 1"
    - "Page title 2"

In Json :

{
  "Server": {
    "Confluence": "https://my.confluence.server.com"
  },
  "Pages to export": {
    "<Space Key 1>": "Page title 1",
    "<Space Key 2>": [
      "Page title 1", 
      "Page title 2"
    ]
  }
}

The space key can be found easily in the URL of any page :

https://my_confluence_url.com/display/<Space key>/...

Server configuration

The Server node will configure the URL of the Confluence server. For the moment, only the username/token authentication is supported. The credentials could be defined with environment variables or .env file.

ATLASSIAN_USER=<your login>
ATLASSIAN_TOKEN=<your token>

In Yaml :

Server:
  Confluence: "https://my.confluence.server.com"

In Json :

{
  "Server": {
    "Confluence": "https://my.confluence.server.com"
  }
}

Server

Main configuration node for server.
It is a mandatory field.

Confluence

Define the Confluence server URL to get the pages.
It is a mandatory field.

Pages to export configuration

The Pages to export node will configure the list of pages to export by space. It could be one page only or a list of pages.

In Yaml :

Pages to export:
  <Space Key 1>: "Page title 1"
  <Space Key 2>:
    - "Page title 2"
    - "Page title 3"

In Json :

{
  "Pages to export": {
    "<Space Key 1>": "Page title 1",
    "<Space Key 2>": [
      "Page title 2",
      "Page title 3"
    ]
  }
}

Pages to export

Main configuration node for exporter.
It is a mandatory field.

<Space key>

Define the space key that include the pages to export. The value associated could be a string or a list of string corresponding to the pages title to export.
It is a mandatory field.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confluence-exporter-0.2.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

confluence_exporter-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file confluence-exporter-0.2.0.tar.gz.

File metadata

  • Download URL: confluence-exporter-0.2.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for confluence-exporter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 27373d534b8d19065ba25bf6d7f37bcb0681c2c1f6f871baaee1837726463b2f
MD5 f326e797b7ef42edf72a436659042cf9
BLAKE2b-256 6cca278361eafad2647a7ad3c72f003084e8f793adfe863d12accd55cb7f3ec6

See more details on using hashes here.

Provenance

File details

Details for the file confluence_exporter-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for confluence_exporter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8d87e4bb1cc3ebd12dc95b71fd641cc6cc3aa424c6160ac46396e5a1417e934
MD5 6a9b00200b7af6de157760775a41b9ba
BLAKE2b-256 ccab42357f1b95c7a6616516cfead8bba6874391cbcc09c4b92d198a58af1297

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page