Skip to main content

Composable HTML email components and templates with Jinja-friendly output.

Project description

pyzahidal

Composable Python components for building HTML emails with Jinja-friendly output.

pyzahidal is designed for teams that want reusable email building blocks instead of maintaining large hand-written HTML templates.

What you get

  • Email-safe primitives such as sections, stacks, columns, buttons, tables, alerts, avatars, and spacing
  • Reusable sections such as heroes, pricing, blog lists, product lists, carts, order summaries, and footers
  • Starter templates for common marketing, editorial, promotion, product, and order flows
  • Theme presets with token overrides
  • Jinja-friendly rendering via raw(), jinja(), and render_template()

Install

From PyPI:

pip install pyzahidal

From a checkout:

pip install -e .

Or run directly from the repository:

PYTHONPATH=src python your_script.py

First example

from pyzahidal import ActionSpec, EmailDocument, Hero

email = EmailDocument(
    preview_text="Composable emails with Jinja output",
    sections=[
        Hero(
            eyebrow="Launch week",
            title="Build emails from reusable sections",
            body="Start with a document shell, add sections, then customize only what you need.",
            primary_action=ActionSpec("Explore", href="https://example.com/docs"),
        )
    ]
)

html = email.render()

html is a complete HTML email document.

When you want template expressions preserved, use raw(), jinja(), and render_template().

Documentation

The docs are organized for first-time users first:

  • Start Here: library overview and where to begin
  • Quickstart: first working email and Jinja-safe rendering
  • Core Concepts: document shell, sections, primitives, themes, and templates
  • Recipes: common paths like marketing, newsletter, promo, and ecommerce emails
  • Examples: curated previews grouped by use case
  • Reference: generated component, template, and theme reference

Generate or refresh the docs with:

python -m scripts.docs

The unified command runs docs generation, screenshot capture, and mkdocs build in the correct order.

Use python -m scripts.docs --no-screenshots or python -m scripts.docs --no-build when you want a partial refresh.

The generation stage writes:

  • docs/generated/components.md
  • docs/generated/examples.md
  • docs/generated/templates.md
  • docs/generated/themes.md
  • docs/generated/api-inventory.json
  • docs/assets/examples/*.html

The generated reference pages include constructor signatures, options, code snippets, and rendered previews. The authored guide pages stay separate from generated build artifacts.

Project details


Download files

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

Source Distribution

pyzahidal-0.1.3.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

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

pyzahidal-0.1.3-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file pyzahidal-0.1.3.tar.gz.

File metadata

  • Download URL: pyzahidal-0.1.3.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyzahidal-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c874d28c1d67c6e71034d20e5fd6a4acfbf6046665d8c3df6f40fbc5cf5f4383
MD5 32bc075262d8cdc59afef1bbe03e45a8
BLAKE2b-256 3207863c797c09a1e38a309dc78c38c7c4b751dad011cd0d9f6a946b638c6c76

See more details on using hashes here.

File details

Details for the file pyzahidal-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyzahidal-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyzahidal-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0667c2a0b1ff313cf44ca23fdb26247a5e40e44024a7963ce0ea8f13d0a370e
MD5 6f1c97da664de5ee6ef17deedbc771ca
BLAKE2b-256 465720fbf53ca37f493eb052b2268b70400d919914a3528811e4b80304b5a7db

See more details on using hashes here.

Supported by

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