Metadata-Version: 2.4
Name: markdown2pdf-python
Version: 0.1.11
Summary: ⚡ Python client for markdown2pdf.ai - Convert markdown to PDF with Lightning payments
Author: Serendipity AI
License: MIT
Project-URL: Homepage, https://markdown2pdf.ai
Project-URL: Documentation, https://markdown2pdf.ai
Project-URL: Repository, https://github.com/Serendipity-AI/markdown2pdf-python
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dotenv>=0.9.9
Requires-Dist: httpx>=0.24.1
Requires-Dist: requests
Dynamic: license-file

⚡ Markdown to PDF conversion, for agents. ⚡

**Agents speak Markdown. Humans prefer PDF.
Bridge the gap for the final stage of your agentic workflow.
No sign-ups, no credit cards, just sats for bytes.**

Read the full documentation at [markdown2pdf.ai](https://markdown2pdf.ai)

Here’s the output of a markdown file converted to PDF format, showing cover page, table of contents and table support. Our engine is powered by LaTeX rather than HTML to PDF conversion as many other libraries and services use, which results in a much higher quality, print-ready output.

<img src="https://raw.githubusercontent.com/Serendipity-AI/markdown2pdf-python/refs/heads/master/images/examples.png" />

This package provides a python client for the markdown2pdf.ai service. You can read full instructions in [our documentation](https://markdown2pdf.ai).

## Installation

```
pip install markdown2pdf-python
```

## Usage

```python

from markdown2pdf import MarkdownPDF

def pay(offer):
    print("⚡ Lightning payment required")
    print(f"Amount: {offer['amount']} {offer['currency']}")
    print(f"Description: {offer['description']}")
    print(f"Invoice: {offer['payment_request']}")
    input("Press Enter once paid...")

client = MarkdownPDF(on_payment_request=pay)
path = client.convert(markdown="# Save this one", title="My document title", download_path="output.pdf")
print("Saved PDF to:", path)
```
