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

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.3
File Size Uploaded
confluence_md_exporter-1.0.3.tar.gz 50.5 kB Details

Built distribution (wheel)

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

Total release size: 81.8 kB

Release files / confluence_md_exporter-1.0.3.tar.gz

Download URL confluence_md_exporter-1.0.3.tar.gz
Size 50.5 kB
Tags Source
SHA-256 checksum
How to use checksums
407e3ed94af48917280b6391a17ec2afdd6157b3d7f3d78f413cb02f18d59889
BLAKE2b-256 checksum
How to use checksums
de06f8eb1b9c039148f3e5bb70ec1544611b4a6768e56d44ac6b8ad91218e12f
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.3-py3-none-any.whl

Download URL confluence_md_exporter-1.0.3-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9487d03c40e6c754c22b2fb954e8bba74872228b55f2c0db0134bbdec376833
BLAKE2b-256 checksum
How to use checksums
dedf839c74e614458061ccb3f70f4d0ab3e8e70bd15638214ac5fb91c38af054
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

This release

1.0.3 This release

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