Skip to main content

Tool to sync Confluence pages with local markdown files using version control

Project description

Confluence Sync

A Python tool to synchronize Confluence pages with local markdown files using version control to prevent conflicts.

Features

  • Pull: Download Confluence pages as markdown files to your local directory
  • Push: Upload local markdown changes back to Confluence with version conflict detection
  • Status: See which files have been modified locally or remotely
  • Version Control: Prevents overwriting remote changes by checking page versions before pushing

Installation

This project uses uv for dependency management.

# Clone the repository
git clone <repository-url>
cd confluence-sync

# Install dependencies
uv sync

# Install the CLI tool
uv pip install -e .

Configuration

Create a configuration file using:

confluence-sync init

This creates a confluence-sync.yml file. Edit it with your Confluence details:

confluence:
  url: "https://your-domain.atlassian.net"
  username: "your-email@domain.com"
  api_token: "your-api-token"
  space_key: "YOUR_SPACE_KEY"
local_path: "docs"
ignore_patterns:
  - "*.tmp"
  - ".git/*"

Getting an API Token

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click "Create API token"
  3. Give it a label and copy the token
  4. Use your email and the token for authentication

Usage

Pull pages from Confluence

confluence-sync pull

This downloads all pages from the specified space as markdown files.

Check status

confluence-sync status

Shows which files are new, modified, or deleted locally.

Push local changes

# Push all tracked files
confluence-sync push

# Push specific files
confluence-sync push docs/page1.md docs/page2.md

The push command will:

  • Check for version conflicts before uploading
  • Block the push if remote pages have been modified
  • Show which files couldn't be pushed due to conflicts

File Format

Each markdown file includes metadata in the header:

---
confluence_id: 123456789
confluence_title: My Page Title
confluence_version: 5
confluence_parent_id: 987654321
confluence_space_key: MYSPACE
---

# Page Content

Your markdown content here...

Version Control Workflow

  1. Pull to get the latest pages from Confluence
  2. Edit markdown files locally
  3. Status to see what's changed
  4. Push to upload changes
  5. If there are conflicts, pull again to merge remote changes

Project Structure

confluence-sync/
├── src/confluence_sync/
│   ├── __init__.py
│   ├── cli.py           # Command-line interface
│   ├── config.py        # Configuration management
│   ├── confluence_client.py  # Confluence API wrapper
│   └── sync.py          # Main sync logic
├── pyproject.toml       # Project configuration
└── README.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confluence_sync-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confluence_sync-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file confluence_sync-0.1.0.tar.gz.

File metadata

  • Download URL: confluence_sync-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for confluence_sync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b7543db7aec05c7ac01d28d39331ab7e52c0c992486c21bdc1f4905fd54a6be0
MD5 5562f5f55a58fe122597c8612611ccef
BLAKE2b-256 9cfd0315ad18645fc9706fae4988a5d60c8979f7d5db22f4d58e9d06850b231d

See more details on using hashes here.

File details

Details for the file confluence_sync-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for confluence_sync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 995c55f0cdc4f55e6d6eeee6e7921a783db3cccbb2550f8791fae48efadda303
MD5 532697c6627c311f5a8434b55be1a3be
BLAKE2b-256 be1c5a36eb0c71ed0e013aa2a5f8858d758a659a8d3a368d8988ffee85c6134e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page