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.3.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.3.0
File Size Uploaded Provenance Actions
fancy_template-0.3.0.tar.gz 48.1 kB With provenance Details for fancy_template-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 80.3 kB

Release files / fancy_template-0.3.0.tar.gz

Download URL fancy_template-0.3.0.tar.gz
Size 48.1 kB
Tags Source
SHA-256 checksum
How to use checksums
66e07e16b5a275c5c357a2734c8d9e2500b665de7f27076de4bed107ac72dacc
BLAKE2b-256 checksum
How to use checksums
1ae61828b9f51f45ae861e264f6b306e389351c26e0b15b89094f08909c1e7db
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 Oct 29, 2026.

Transparency log

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

Download URL fancy_template-0.3.0-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63653e2d11cbb88d23b22dfd58f9b4cf74253e2e0786b30da13a70487079c8e7
BLAKE2b-256 checksum
How to use checksums
873004f03f0de38c5e77fd1ac9a70c7455143a7b32e67c77597efbaae54ed5b7
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 Oct 29, 2026.

Transparency log

Security for fancy-template 0.3.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.3.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 Oct 29, 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