Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

line-markdown-parser

Convert LLM Markdown into readable LINE Flex Message dictionaries with no runtime dependencies.

日本語

The library builds on conversion logic refined through ongoing use in a LINE bot.

Headings, paragraphs, lists, quotes, code, and links receive a chat-friendly layout. Long output is split into separate messages. Links also work inside headings, quotes, and list items. Sending remains the responsibility of your application.

Installation

Requires Python 3.10 or later.

python -m pip install line-markdown-parser

Quick start

import json

from line_markdown_parser import convert_markdown_to_line_messages

markdown = """# Project update

The **first draft** is ready.

- Review the examples
- Read the [guide](https://example.com/guide)
"""

messages = convert_markdown_to_line_messages(markdown)
print(json.dumps(messages, ensure_ascii=False, indent=2))

Each item has type: "flex", altText, and one bubble in contents. Pass these dictionaries to your LINE API integration. The library makes no network requests and does not require the LINE SDK.

The converter returns all generated messages. LINE accepts up to five message objects per reply or push request, so your application must handle longer results and reply-token restrictions.

API

All functions are exported from line_markdown_parser.

Function Purpose
convert_markdown_to_line_messages Split Markdown and return a list[dict] of Flex Messages.
build_flex_message Build one message without splitting; reject oversized input.
build_flex_contents Build body components for a custom bubble, without a bubble size check.
split_long_text Return Markdown chunks as a list[str].
estimate_flex_payload_size Measure the rendered bubble's compact UTF-8 JSON size.

The converter defaults to 1,600 source characters and 28,000 rendered bytes per chunk. See the API specification for signatures, limits, alternative text, and error behavior.

Limitations

  • Markdown tables use code-style text boxes; column alignment varies by client font.
  • Images appear as labels and links, without fetching or embedding images.
  • Only http and https links receive URI actions; destinations are not verified.
  • Full CommonMark support, arbitrary nesting, and every code-fence style are outside the scope.
  • When integrating, check the output with the Flex Message Simulator and your target LINE clients.

Contributing

See CONTRIBUTING.md for setup and checks, SECURITY.md for vulnerability reporting, and CHANGELOG.md for release history.

License

MIT. This independent project is not an official LINE product.

Metadata

Release files for line-markdown-parser 0.1.5

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

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for line-markdown-parser 0.1.5
File Size Uploaded Provenance
line_markdown_parser-0.1.5.tar.gz 28.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for line-markdown-parser 0.1.5
File Interpreter ABI Platform
line_markdown_parser-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 54.1 kB

Release files / line_markdown_parser-0.1.5.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL line_markdown_parser-0.1.5.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0207e42170f8775f041c7a6c959f3586fa44c07c3925bea2c0e0b6ff36f75f33
BLAKE2b-256 checksum
How to use checksums
663969bb9e376a49bbfe5185e4d6c7938ea88d034a26330f526611d76067d69c
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 22, 2026.

Transparency log

Release files / line_markdown_parser-0.1.5-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL line_markdown_parser-0.1.5-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ba0b09d5e7c9fa492b35e5e020a68cd922a637ec6cfadb7ba5fc40d730b9b23
BLAKE2b-256 checksum
How to use checksums
1e0a46ddf32bc619e7cb1cecafa9266bdc621acee3f66829a3a2e7d6f6ad71e0
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 22, 2026.

Transparency log

Security for line-markdown-parser 0.1.5

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.

Change of provenance

The repository that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Repository

  • Removed 0.1.4 GitHub: darkgaldragon/line-markdown-parser
  • Added 0.1.5 GitHub: darkgaldoggo/line-markdown-parser
Select from 2 files

Attestation for line_markdown_parser-0.1.5.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 22, 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