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, *, jira_mentions: bool = False) -> 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]

Jira account mentions

Pass jira_mentions=True to convert Jira wiki mentions into ADF mention nodes:

markdown_to_adf("Hi [~accountId:557057:user-id]", jira_mentions=True)

This option is disabled by default. Code and escaped mention syntax remain unchanged.

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.3.1

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.3.1
File Size Uploaded Provenance Actions
marklassian-0.3.1.tar.gz 110.5 kB With provenance Details for marklassian-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 119.0 kB

Release files / marklassian-0.3.1.tar.gz

Download URL marklassian-0.3.1.tar.gz
Size 110.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e9c7e565b7d36a3529b536d26d27ebb50413c8c31a9b60361807cf980f7af25a
BLAKE2b-256 checksum
How to use checksums
0e051977e4548214d765c8b78a4fa45bebd68ef1e60881474790c3b30b70139e
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 Oct 30, 2026.

Transparency log

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

Download URL marklassian-0.3.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eeaaeaba516d3221a77dbaea70d20ac1b0e6750344c66e3a7d65c241a0fc56cc
BLAKE2b-256 checksum
How to use checksums
f46d4e7ea38472557c1e5850fe128c1019b52e9fef945e962f5a9c076c7ee285
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 Oct 30, 2026.

Transparency log

Security for marklassian 0.3.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for marklassian-0.3.1.tar.gz

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 Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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