Metadata-Version: 2.4
Name: pyzahidal
Version: 0.1.3
Summary: Composable HTML email components and templates with Jinja-friendly output.
Author: Nyamkhuu Demberelsuren
License: MIT License
        
        Copyright (c) 2026 Nyamkhuu Demberelsuren
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/d-nyamkhuu/pyzahidal
Project-URL: Documentation, https://d-nyamkhuu.github.io/pyzahidal/
Project-URL: Repository, https://github.com/d-nyamkhuu/pyzahidal
Project-URL: Issues, https://github.com/d-nyamkhuu/pyzahidal/issues
Project-URL: Changelog, https://github.com/d-nyamkhuu/pyzahidal/releases
Keywords: email,html-email,jinja,templates,components
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Email
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: twine>=5.1; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Requires-Dist: pillow>=10.4; extra == "docs"
Requires-Dist: playwright>=1.54; extra == "docs"
Dynamic: license-file

# 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:

```bash
pip install pyzahidal
```

From a checkout:

```bash
pip install -e .
```

Or run directly from the repository:

```bash
PYTHONPATH=src python your_script.py
```

## First example

```python
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:

```bash
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.
