{"library":"markdown-to-confluence","title":"Markdown to Confluence Publisher","description":"markdown-to-confluence is a Python library and command-line tool (md-to-conf) designed to publish Markdown files to Confluence wikis. It parses Markdown, converts its content into Confluence Storage Format (XHTML), and invokes Confluence API endpoints to upload pages and attachments (like images). It supports single-page and directory synchronization modes, handling relative links and page hierarchies. The current version is 0.5.8 and it appears to be actively maintained with a focus on ease of use for documentation synchronization.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install markdown-to-confluence"],"cli":{"name":"md-to-conf","version":"sh: 1: md-to-conf: not found"}},"imports":["from md_to_conf.client import ConfluenceClient","from md_to_conf.converter import ConfluenceConverter"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# Create a markdown file named 'my_doc.md'\n# Example content:\n# # My Awesome Documentation\n# This is a paragraph with **bold** text.\n#\n# ## Section 1\n# - Item 1\n# - Item 2\n\nimport os\n\n# Set environment variables for Confluence authentication\n# Replace with your actual values or ensure they are set in your environment\nos.environ['ATLASSIAN_ORGNAME'] = os.environ.get('ATLASSIAN_ORGNAME', 'your_organization') # e.g., 'yourcompany' for yourcompany.atlassian.net\nos.environ['ATLASSIAN_USERNAME'] = os.environ.get('ATLASSIAN_USERNAME', 'your_confluence_email')\nos.environ['ATLASSIAN_API_KEY'] = os.environ.get('ATLASSIAN_API_KEY', 'your_atlassian_api_key')\n\n# To publish 'my_doc.md' to the 'DOC' space in Confluence, using the CLI:\n# Ensure 'md-to-conf' is available in your PATH after installation\n# Example using subprocess (or run directly in your shell):\n\nimport subprocess\n\nmarkdown_file = \"my_doc.md\"\nconfluence_space_key = \"DOC\"\n\n# Create a dummy markdown file for the example\nwith open(markdown_file, \"w\") as f:\n    f.write(\"# My Awesome Documentation\\n\")\n    f.write(\"This is a paragraph with **bold** text.\\n\\n\")\n    f.write(\"## Section 1\\n\")\n    f.write(\"- Item 1\\n\")\n    f.write(\"- Item 2\\n\")\n\nprint(f\"Attempting to publish {markdown_file} to Confluence space {confluence_space_key}...\")\ntry:\n    # Using the command-line interface directly\n    command = [\n        \"md-to-conf\",\n        markdown_file,\n        confluence_space_key,\n        \"--orgname\", os.environ['ATLASSIAN_ORGNAME'],\n        \"--username\", os.environ['ATLASSIAN_USERNAME'],\n        \"--apikey\", os.environ['ATLASSIAN_API_KEY'],\n        \"--verbose\" # Add for detailed output during publishing\n    ]\n    # For security, avoid passing sensitive data directly in `shell=True`\n    process = subprocess.run(command, capture_output=True, text=True, check=True)\n    print(\"Publishing successful (or simulated if --simulate was used).\")\n    print(\"STDOUT:\", process.stdout)\n    print(\"STDERR:\", process.stderr)\nexcept subprocess.CalledProcessError as e:\n    print(f\"Error publishing: {e}\")\n    print(\"STDOUT:\", e.stdout)\n    print(\"STDERR:\", e.stderr)\n    print(\"Hint: Check your Confluence credentials, organization name, and space key.\")\n    print(\"Also ensure the Confluence API key has sufficient permissions.\")\nexcept FileNotFoundError:\n    print(\"Error: 'md-to-conf' command not found. Is markdown-to-confluence installed and in your PATH?\")\n\n# Clean up dummy file\nos.remove(markdown_file)\n","lang":"python","description":"The `markdown-to-confluence` library is primarily used via its command-line interface, `md-to-conf`. This quickstart demonstrates how to publish a single Markdown file to a specified Confluence space using environment variables for authentication. Replace placeholder values with your actual Confluence organization name, username (email), and API key.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"0.4.8","pypi_latest":"0.5.9","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4.2,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"43.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4.4,"import_time_s":null,"mem_mb":null,"disk_size":"45M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"45.2M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.8,"import_time_s":null,"mem_mb":null,"disk_size":"46M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"36.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.7,"import_time_s":null,"mem_mb":null,"disk_size":"38M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"36.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.6,"import_time_s":null,"mem_mb":null,"disk_size":"38M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"43.1M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"markdown-to-confluence","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":5.6,"import_time_s":null,"mem_mb":null,"disk_size":"44M"}]}}