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.15.

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.5

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.5
File Size Uploaded
confluence_md_exporter-1.0.5.tar.gz 52.9 kB Details

Built distribution (wheel)

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

Total release size: 85.8 kB

Release files / confluence_md_exporter-1.0.5.tar.gz

Download URL confluence_md_exporter-1.0.5.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
263d14f4f931abfe779338d3ec2345c75247000f9c9e1971decfd77f242256da
BLAKE2b-256 checksum
How to use checksums
8e4c814e5fa6c74b149421bf4abbf13212876a99ad04fdad7fde10e3e2a49255
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.5-py3-none-any.whl

Download URL confluence_md_exporter-1.0.5-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c303dec1f1e472d9f51cbefc5d2379f6df0744f89dbc5a40128c984a6a78338b
BLAKE2b-256 checksum
How to use checksums
cd372389fed6086f80bd5a8756c46a5eb3d28143e5ce00545c64e30c91d3c6cc
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

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

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