Skip to main content

marklassian-py

A lightweight Python library that converts Markdown to the Atlassian Document Format (ADF). Built for easy integration with Atlassian products like Jira and Confluence.

This is a Python port of the excellent marklassian JavaScript library by @jamsinclair.

Features

  • Convert Markdown to ADF with a single function call
  • Support for common Markdown syntax including GFM task lists
  • Minimal dependencies (only mistune)
  • Full type hints for IDE support
  • Python 3.10+

Installation

pip install marklassian

Or with uv:

uv add marklassian

Usage

from marklassian import markdown_to_adf

markdown = "# Hello World\n\nThis is **bold** and *italic* text."
adf = markdown_to_adf(markdown)

The result is a dictionary that can be serialized to JSON:

import json
print(json.dumps(adf, indent=2))

Supported Markdown Features

  • Headings (H1-H6)
  • Paragraphs and line breaks
  • Emphasis (bold, italic, strikethrough)
  • Links and images
  • Inline code and code blocks with language support
  • Ordered and unordered lists with nesting
  • Blockquotes
  • Horizontal rules
  • Tables
  • Task lists (GitHub Flavored Markdown)

API Reference

markdown_to_adf(markdown: str) -> AdfDocument

Converts a Markdown string to an ADF document object.

Types

class AdfMark(TypedDict, total=False):
    type: Required[str]
    attrs: dict[str, Any]

class AdfNode(TypedDict, total=False):
    type: Required[str]
    attrs: dict[str, Any]
    content: list[AdfNode]
    marks: list[AdfMark]
    text: str

class AdfDocument(TypedDict):
    version: Literal[1]
    type: Literal["doc"]
    content: list[AdfNode]

Caveats

This library aims to provide a lightweight and mostly accurate conversion from Markdown to ADF.

For complex Markdown documents or strict ADF conformance requirements, consider using the official Atlassian libraries. Note that those are heavier dependencies.

References

Credits

This library is a Python port of marklassian by Jamie Sinclair. All credit for the original implementation and conversion logic goes to them.

License

MIT - see LICENSE for details.

Metadata

Release files for marklassian 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marklassian 0.2.0
File Size Uploaded
marklassian-0.2.0.tar.gz 104.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for marklassian 0.2.0
File Interpreter ABI Platform
marklassian-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 112.1 kB

Release files / marklassian-0.2.0.tar.gz

Download URL marklassian-0.2.0.tar.gz
Size 104.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fb90c8cce213a50b1401e51e67c22d2f2d323d26b5625ee4bb0a016fc6470bbe
BLAKE2b-256 checksum
How to use checksums
87fe6ac000144a454baa9a3108a61d8ad0ba4ed26da05b709095e600a5a43d30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / marklassian-0.2.0-py3-none-any.whl

Download URL marklassian-0.2.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11fd5274c4c0ee43d734c4691bf530f9651d1e470723bbfdb477aaf909819db0
BLAKE2b-256 checksum
How to use checksums
6000cc477202f7b5a05f80634efc484251ab50a3ad2a136869796918c5860228
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page