pack

Confluence DocPack Core Module

High-level API for exporting Confluence pages from multiple spaces to XML format for AI knowledge base ingestion.

class docpack_confluence.pack.SpaceExportConfig(client: Confluence, space_id: int | None = None, space_key: str | None = None, include: list[str] | None = None, exclude: list[str] | None = None, breadcrumb_type: BreadCrumbTypeEnum = BreadCrumbTypeEnum.title, wanted_fields: set[ConfluencePageFieldEnum] | None = None, ignore_to_markdown_error: bool = True)[source]

Configuration for exporting pages from a single Confluence space.

Parameters:
  • client – Confluence API client

  • space_id – Space ID (mutually exclusive with space_key)

  • space_key – Space key (mutually exclusive with space_id)

  • include – Glob patterns for pages to include

  • exclude – Glob patterns for pages to exclude

  • breadcrumb_type – Filename format - use page IDs or titles

  • wanted_fields – Fields to include in XML output

  • ignore_to_markdown_error – Skip errors during markdown conversion

property space_identifier: str

Unique identifier string for output directory naming.

export(dir_out: Path, encoding: str = 'utf-8') None[source]

Export filtered pages from this space to XML files.

Parameters:
  • dir_out – Output directory for XML files

  • encoding – Output file encoding

class docpack_confluence.pack.ExportSpec(space_configs: list[SpaceExportConfig], dir_out: Path, encoding: str = 'utf-8')[source]

Specification for exporting pages from multiple Confluence spaces.

Parameters:
  • space_configs – List of space export configurations

  • dir_out – Root output directory

  • encoding – File encoding for all output files

property path_merged_output: Path

Path to merged knowledge base file.

export() None[source]

Execute the export: crawl, filter, and export pages from all spaces, then merge into a single knowledge base file.