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.0.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.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zconvert-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 d44de3fce26f750aac13bab85f148cfb3a3a45fa81f43e98cfb2076cd762a383
MD5 0656f970e9316d21f2b158778c3ef814
BLAKE2b-256 6f63e5c598d3d8be22a09caaee0885300312d7775e9be025bdfd3434508a483e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zconvert-1.0.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98e1273211ae3f757b160dd4fcaaa2ebfc38a57b0679e7eba62690f23a3a7caa
MD5 710e99ddd596e51ebfaff5a337963818
BLAKE2b-256 1cc08018430b1e305de4a1c9a4b8f0f5378858cc7870740fd60c83d44cf58cb7

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

1.1.0

2 files

This release

1.0.0 This release

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