ADF Lib

raw JSON →
0.2.1 verified Fri May 01 auth: no python

A Python library for creating and manipulating ADF (Atlassian Document Format) documents. Current version 0.2.1, requires Python >=3.8. Early stage development with infrequent releases.

pip install adf-lib
error ModuleNotFoundError: No module named 'adf_lib'
cause You are trying to import 'adf_lib' as a module, but the correct import is 'adf_lib' (with underscore).
fix
Run 'pip install adf-lib' and then use 'from adf_lib import ...'.
error ImportError: cannot import name 'Document' from 'adf_lib'
cause The library uses prefixed class names (e.g., 'ADFDocument'), not plain 'Document'.
fix
Use 'from adf_lib import ADFDocument'.
gotcha All classes are prefixed with 'ADF'. Using names like 'Document' or 'Paragraph' will cause ImportError.
fix Use the full prefixed class names: ADFDocument, ADFParagraph, etc.
gotcha The library is in early alpha stage (v0.2.1). APIs may break without notice.
fix Pin the exact version in requirements and test upgrades thoroughly.

Create an ADF document with a paragraph and output the dictionary representation.

from adf_lib import ADFDocument, ADFParagraph

doc = ADFDocument()
p = ADFParagraph(text='Hello, world!')
doc.add(p)
print(doc.to_dict())