Skip to main content

zconvert

Python client for ZConvert — HTML decks to native, editable PowerPoint; Markdown to PDF and Word.

The client is tiny (one dependency, httpx) and talks to a ZConvert server, which does the rendering. Server, deck-authoring rules and the Node/Rust SDKs: https://github.com/YatchiYa/html-to-pptx.

pip install zconvert

Use

from zconvert import ZConvert

z = ZConvert("http://localhost:8000")     # or set ZCONVERT_URL

# The source can be a path, a string of content, or bytes.
z.html_to_pptx("deck.html", out="deck.pptx")
z.html_to_pptx(html_string, filename="deck.html", out="deck.pptx")

z.md_to_pdf("# Hello\n\nWorld", out="hello.pdf")
z.md_to_docx("report.md", title="Q4 review", out="report.docx")

out is optional — every call returns the bytes:

pptx = z.html_to_pptx("deck.html")

Start from a skeleton

deck.html documents the HTML deck rules in its own header comment; document.md shows every supported Markdown feature.

z.save_example("deck.html")          # writes ./deck.html
z.save_example("document.md", "docs/document.md")
z.examples()                         # [{name, description, convert_to}, …]

Parameters

Only what you set is sent, so the server's defaults stay authoritative.

z.html_to_pptx(
    "deck.html",
    mode="image",            # "native" (default, editable) | "image" (pixel-exact)
    embed_fonts=False,       # default True
    real_background=False,   # default True
    font_body="Inter",
    font_heading="Poppins",
    timeout_ms=60_000,       # per-slide render budget
)

z.md_to_pdf("report.md", title="Q4 review")

convert() is the general form when you want to pass to yourself:

z.convert("report.md", to="docx", out="report.docx")

HTML converts to pptx only; Markdown converts to pdf or docx. An impossible pair raises ValueError before any request is made.

Async

from zconvert import AsyncZConvert

z = AsyncZConvert("http://localhost:8000")
pdf = await z.md_to_pdf("# Hello", filename="hello.md")

Errors

from zconvert import ZConvertError

try:
    z.html_to_pptx("deck.html")
except ZConvertError as e:
    print(e.status, e.detail)     # 422 "no slides found in input"

How a source is interpreted

You pass Treated as
Path("deck.html") a file, always
"deck.html" (exists on disk) a file
"# Title\n\nBody" (has a newline) content
"<section>x</section>" (no such file) content
b"..." content

Pass filename= with inline content: the extension picks the pipeline and the stem names the output.

Discovery

z.health()      # {"status": "ok", "version": "1.0.0"}
z.manifest()    # conversions, every parameter, defaults, limits

Test

pytest      # stubbed transport, no server needed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zconvert-1.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zconvert-1.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file zconvert-1.1.0.tar.gz.

File metadata

  • Download URL: zconvert-1.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for zconvert-1.1.0.tar.gz
Algorithm Hash digest
SHA256 309874ab36b294957e7d61d24610c204bfd0b5f1bd62811898276165aafd9c0b
MD5 eaa30c5fea514ed01ac587cfe03303bd
BLAKE2b-256 b19a91e5afdb22be1deb02002449580731aa5b9952a27927e041f8239e1fba6b

See more details on using hashes here.

File details

Details for the file zconvert-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: zconvert-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for zconvert-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d4366e4f26d01a45c61f6a2f22357dab60e6de75f2eb0f3a44368cc5bd9bb55
MD5 12676e826ee1815d289b2f1d1b0dad7f
BLAKE2b-256 9032baf87e98496e47040e1e6a69c7498416cf9e048bbd05ec73f92dd5954ca6

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

This release

1.1.0 This release

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page