Skip to main content

fancy-template (Python)

Document templates for the Fancy document writers: a writer document (fine-print, last-word, dark-slide, holy-sheet JSON) with {{ tokens }} in some string values and JSON directives on some array items, plus a declaration of the data it needs. One specification, three implementations (Python, TypeScript, PHP), all asserted against the same template/* table in fancy-conformance.

from fancy_template import inspect, validate_data, render

inspect(template)["issues"]  # at SAVE time, no data
validate_data(template, data)  # before rendering
doc = render(template, data)  # plain writer JSON, or raises TemplateError

import holy_sheet

holy_sheet.to_bytes(doc)  # the writer validates it again

What it guarantees

  • Missing data is loud. An absent value raises TemplateError with a stable code, a JSON Pointer path into the template and the variable path -- never the data value itself.
  • No code execution, no includes. Tokens are paths plus a fixed filter list; $if is a sandboxed fancy-expr expression; data is reduced to plain JSON before anything reads it, and no method of a host object is ever called.
  • Profiles are allowlists. Only listed fields take tokens. holy-sheet cells write every string result as {"value": s}, so user data can never become a formula; dark-slide escapes values for the element's markdown or html.
  • Bounded everywhere, with a stable error code per bound.

Where Python differs from its own instincts

  • True == 1 is true in Python; here a boolean is never a number, and {"fancyTemplate": True} is refused.
  • str.isalpha, str.isdigit and re's \d are Unicode-aware; names, dates and digits here are ASCII only, as in the other legs.
  • The recursion limit sits below the 4096 levels the other legs accept as JSON, so every walk of unknown depth is iterative.

The specification is SPEC.md in the repository root.

Metadata

Release files for fancy-template 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fancy-template 0.4.0
File Size Uploaded Provenance Actions
fancy_template-0.4.0.tar.gz 49.4 kB With provenance Details for fancy_template-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fancy-template 0.4.0
File Interpreter ABI Platform Actions
fancy_template-0.4.0-py3-none-any.whl Python 3 none any Details for fancy_template-0.4.0-py3-none-any.whl

Total release size: 82.1 kB

Release files / fancy_template-0.4.0.tar.gz

Download URL fancy_template-0.4.0.tar.gz
Size 49.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cb44e80fb85ec93330e49dcaf3f1fdc3ab68519c01ed3b78bab9e5d26ca671bd
BLAKE2b-256 checksum
How to use checksums
88f44e74fec686f9785aa0c497a634cc96bee5d29868470395e7dac5eea0ba95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / fancy_template-0.4.0-py3-none-any.whl

Download URL fancy_template-0.4.0-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81943db9449ff8aa8eba4c150478a5b7922c60ee4c85b14830c6105a1e4b3348
BLAKE2b-256 checksum
How to use checksums
2a0307cbc7686e20c9ab4236efc872476f28f0fd43738fec33d7e1f5498d6df5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for fancy-template 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fancy_template-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page