Metadata-Version: 2.4
Name: adf-parse
Version: 0.1.0
Summary: Convert Atlassian Document Format (ADF) from Jira/Confluence into plain text or Markdown
Keywords: adf,atlassian,jira,confluence,markdown,parser
Author: Abhishek Hazra
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/hazra1991/adf-parse
Project-URL: Repository, https://github.com/hazra1991/adf-parse
Description-Content-Type: text/markdown

# adf-parse

Convert [Atlassian Document Format (ADF)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/) — the JSON format used by Jira and Confluence — into plain text / Markdown.

Zero dependencies. Supports paragraphs, headings, bullet/ordered lists (with nesting), code blocks, tables (with header detection), blockquotes, panels, expands, task lists, mentions, dates, statuses, inline cards, hard breaks, rules, and media references.

## Installation

```bash
pip install adf-parse
```

Requires Python 3.11+.

## Usage

```python
from adf_parse import create_md_doc, parse_doc

adf = {
    "type": "doc",
    "version": 1,
    "content": [
        {"type": "heading", "attrs": {"level": 2},
         "content": [{"type": "text", "text": "Release notes"}]},
        {"type": "paragraph",
         "content": [{"type": "text", "text": "See the docs",
                      "marks": [{"type": "link", "attrs": {"href": "https://example.com"}}]}]},
    ],
}

print(create_md_doc(adf))
# ## Release notes
# See the docs (https://example.com)
```

To also get the extracted links and media references, use `parse_doc`:

```python
result = parse_doc(adf)
result.collected_text  # list of rendered blocks
result.links           # list of (text, href) tuples
result.media_ref       # list of MediaRef(ref_type, ref)
```

## License

MIT
