Skip to main content

confluence-md-exporter

English | Русский

Local read-only export of Confluence Server/Data Center pages to Markdown: page body, attachments, version diffs, and a batch report.

It does not write to Confluence, walk descendants, or talk to Cloud. Python >=3.11,<3.14.

Install

pip install confluence-md-exporter

or

uv tool install confluence-md-exporter

Check: confluence-md-exporter --version. Help: confluence-md-exporter -h.

Use cases

In every example the URL list is a UTF-8 text file, one page per line. #… lines and blank lines are ignored.

Public instance

Pages are readable without login. The Confluence base URL is taken from absolute links, so --base-url is not needed.

urls.txt:

https://confluence.example.com/pages/viewpage.action?pageId=123456
https://confluence.example.com/display/SPACE/Page+Title
confluence-md-exporter -i urls.txt -o output

Private instance: Personal Access Token

Token without a username → Bearer.

confluence-md-exporter -i urls.txt -o output -t PAT

Private instance: username and password (or username and PAT)

Username + token → HTTP Basic.

confluence-md-exporter -i urls.txt -o output -u USER -t TOKEN

Page ids only

If the list is ids such as 123456 rather than full URLs, the base URL must be set explicitly.

ids.txt:

123456
789012
confluence-md-exporter -i ids.txt -o output --base-url https://confluence.example.com

Compare two versions of a page

Put a Confluence diff URL in the list. Markdown with YAML metadata and a ```diff block is written under output/05_diffs/.

https://confluence.example.com/pages/diffpagesbyversion.action?pageId=607636678&selectedPageVersions=41&selectedPageVersions=42
confluence-md-exporter -i urls.txt -o output -t PAT

Re-run, refresh, clean start

A second run into the same -o skips a page when the local version matches the server and attachment files are still on disk (disk-skip).

Goal Command
Fetch only what changed confluence-md-exporter -i urls.txt -o output
Re-fetch everything, keep the directory confluence-md-exporter -i urls.txt -o output -r
Delete the output and export from scratch confluence-md-exporter -i urls.txt -o output -c

Credentials can live in .env (CONFLUENCE_TOKEN, CONFLUENCE_USERNAME, …). CLI flags override the environment. Do not commit .env.

Input line formats

Kind Example
Page by id https://host/pages/viewpage.action?pageId=123456
Page in a space https://host/wiki/spaces/SPACE/pages/123456/Title
Id only 123456 (needs --base-url if the file has no absolute URLs)
Space and title https://host/display/SPACE/Page+Title
Version diff …/pages/diffpagesbyversion.action?pageId=…&selectedPageVersions=41&selectedPageVersions=42
Version diff …/diffpagesbyversion.action?pageId=…&originalVersion=41&revisedVersion=42

Unsupported lines (tiny-link /x/… and the like) are recorded in run_report.json as invalid_urls and do not fail the batch.

Output layout

output/
├── 01_raw/             # raw REST JSON
├── 02_interim/         # Storage XML
├── 03_assets/          # attachments and images (per page_id)
├── 04_markdown/        # Markdown pages and manifest.json
├── 05_diffs/           # unified diff of two versions (*_v41_to_v42.md)
└── run_report.json     # batch summary

Exit codes

Code When
0 every processed page is ok or skipped
1 at least one page is failed
2 missing input file, bad configuration, or failed authentication

Development

uv sync
uv run python -m pytest

Release files for confluence-md-exporter 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for confluence-md-exporter 1.0.1
File Size Uploaded
confluence_md_exporter-1.0.1.tar.gz 49.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for confluence-md-exporter 1.0.1
File Interpreter ABI Platform
confluence_md_exporter-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 80.7 kB

Release files / confluence_md_exporter-1.0.1.tar.gz

Download URL confluence_md_exporter-1.0.1.tar.gz
Size 49.4 kB
Tags Source
SHA-256 checksum
How to use checksums
43e35e7aa99587edb8718f0adad8f51b7b73494c270c79a5e266cb2e86502f22
BLAKE2b-256 checksum
How to use checksums
b812932e551c7e372273ddc439d243e704ec2be972be80d6e00d6af22f9cafad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / confluence_md_exporter-1.0.1-py3-none-any.whl

Download URL confluence_md_exporter-1.0.1-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fc9b50b3fb1b89e4157fe7ebaff49205a9dea30eb6fe7e3a1673b45c003a149
BLAKE2b-256 checksum
How to use checksums
1c33b83b7270b754f72058bfa786bdc53b9631e019fc00bfe6844e9957217309
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page