md2cf
raw JSON → 2.3.0 verified Fri May 01 auth: no python
Convert Markdown documents to Confluence pages. Current version 2.3.0 supports relative links, automatic retries, and various output modes. Releases are irregular but maintained.
pip install md2cf Common errors
error ModuleNotFoundError: No module named 'md2cf' ↓
cause md2cf is a CLI tool and its Python package might not expose a module named 'md2cf' directly. Use the command-line interface or install from source if you need the module.
fix
Run
md2cf --help from the terminal. If you need programmatic access, use subprocess to call the CLI. error AttributeError: module 'md2cf' has no attribute 'convert' ↓
cause The Python module does not expose a public API; md2cf is primarily a CLI tool.
fix
Use the command line:
md2cf --space SPACE --url URL ... README.md error Error: unrecognized arguments: --bearer-token ↓
cause The `--bearer-token` flag was renamed to `--token` in version 2.0.0.
fix
Replace
--bearer-token with --token. Warnings
breaking In version 2.0.0, the CLI changed from `--bearer-token` to `--token`. Old scripts using `--bearer-token` will break. ↓
fix Replace `--bearer-token` with `--token` in CLI commands or scripts.
gotcha Automatic retries in v2.3.0 apply to all errors, not just HTTP 429. This can cause long delays on persistent failures. ↓
fix To avoid delays, ensure your network and Confluence API are stable. There is no configuration to disable retries.
gotcha .gitignore is now used to skip files by default. If you want to include ignored files, use `--no-ignore-gitignore`. ↓
fix Pass `--no-ignore-gitignore` flag to include .gitignored files.
Imports
- md2cf
import md2cf
Quickstart
import os
from md2cf import convert
# Requires environment variables or config file
result = convert(
path='README.md',
space=os.environ.get('CONFLUENCE_SPACE', ''),
parent=os.environ.get('CONFLUENCE_PARENT', ''),
url=os.environ.get('CONFLUENCE_URL', ''),
username=os.environ.get('CONFLUENCE_USERNAME', ''),
token=os.environ.get('CONFLUENCE_TOKEN', '')
)
print(result)