Export Confluence pages to Markdown files
Project description
confluence2md
Export Confluence pages to Markdown files because using Confluence (or any other Atlassian product for that matter, like Jira) sucks. Works as a CLI tool and as a Python library.
Installation
uv sync
Configuration
Copy config.yaml.example to config.yaml and adjust it to your Confluence instance:
confluence:
url: https://your-instance.atlassian.net/wiki
token: your-personal-access-token
username: your-email@example.com
output:
directory: ./export
filename_pattern: "{title}"
include_children: false
include_labels: true
include_metadata: true
The token can also be set via the CONFLUENCE2MD_TOKEN environment variable. The username can be set via CONFLUENCE2MD_USERNAME.
For Confluence Cloud, both username (your email) and token (API token) are required. For Confluence Server/Data Center with personal access tokens, only token is needed.
CLI Usage
Export pages matching a CQL query:
confluence2md export --cql "space = DEV AND label = api"
Export a single page by ID:
confluence2md export --page-id 12345
Export a page and its children:
confluence2md export --page-id 12345 --include-children
Export all pages from a space:
confluence2md export --space DEV
Override the output directory:
confluence2md export --cql "space = DEV" --output-dir ./docs
Use a specific config file:
confluence2md -c path/to/config.yaml export --space DEV
List available spaces:
confluence2md list-spaces
confluence2md list-spaces --search "dev"
Library Usage
from confluence2md import load_config, connect, fetch_pages_by_cql, export_pages
config = load_config("config.yaml")
confluence = connect(config.confluence)
pages = fetch_pages_by_cql(confluence, "space = DEV", max_results=100)
paths = export_pages(pages, config.output)
You can also render Markdown without writing files:
from confluence2md import render_page
markdown = render_page(page, config.output)
print(markdown)
Releasing
./scripts/release.sh patch # 0.1.0 → 0.1.1
./scripts/release.sh minor # 0.1.0 → 0.2.0
./scripts/release.sh major # 0.1.0 → 1.0.0
This bumps the version in pyproject.toml, commits, tags, and pushes. The push triggers a GitHub Actions workflow that publishes the package to PyPI.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file confluence2md-0.3.0.tar.gz.
File metadata
- Download URL: confluence2md-0.3.0.tar.gz
- Upload date:
- Size: 44.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af0151feb5a24bb5564384dd1b90d75e6fbbde3366f71835d4f91715696e434a
|
|
| MD5 |
cdda0da91f2ae4fe0978c7b8acaa892b
|
|
| BLAKE2b-256 |
58766083ee516847dbf75b1d8481a0917626bafbb7846968131f42daa176d847
|
Provenance
The following attestation bundles were made for confluence2md-0.3.0.tar.gz:
Publisher:
release.yml on splieth/confluence2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
confluence2md-0.3.0.tar.gz -
Subject digest:
af0151feb5a24bb5564384dd1b90d75e6fbbde3366f71835d4f91715696e434a - Sigstore transparency entry: 1188799439
- Sigstore integration time:
-
Permalink:
splieth/confluence2md@423e43a7d38cc3c80e04f70e4e63a8b2552e686f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/splieth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@423e43a7d38cc3c80e04f70e4e63a8b2552e686f -
Trigger Event:
push
-
Statement type:
File details
Details for the file confluence2md-0.3.0-py3-none-any.whl.
File metadata
- Download URL: confluence2md-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10217eac1b16759b42d4418fff72c7bee734d7874435eea53b3df893ff40c58c
|
|
| MD5 |
198aa1e6d1cf6df3aa5d756900c437f7
|
|
| BLAKE2b-256 |
a58362e6d6b766067e26154d7433d96a8f3edb20b79a3ed206bca7182f5fbde7
|
Provenance
The following attestation bundles were made for confluence2md-0.3.0-py3-none-any.whl:
Publisher:
release.yml on splieth/confluence2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
confluence2md-0.3.0-py3-none-any.whl -
Subject digest:
10217eac1b16759b42d4418fff72c7bee734d7874435eea53b3df893ff40c58c - Sigstore transparency entry: 1188799442
- Sigstore integration time:
-
Permalink:
splieth/confluence2md@423e43a7d38cc3c80e04f70e4e63a8b2552e686f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/splieth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@423e43a7d38cc3c80e04f70e4e63a8b2552e686f -
Trigger Event:
push
-
Statement type: