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.2.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.2.0
File Size Uploaded Provenance Actions
fancy_template-0.2.0.tar.gz 39.1 kB With provenance Details for fancy_template-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 70.4 kB

Release files / fancy_template-0.2.0.tar.gz

Download URL fancy_template-0.2.0.tar.gz
Size 39.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0e23cf5d99516e33b81a0c4f89d19281f7d5185499947bcce137b15ccb4016e1
BLAKE2b-256 checksum
How to use checksums
b0793d7eb587410a0713b91960e85df922175426a485e80ef7ee836f3b1a26b9
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 27, 2026.

Transparency log

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

Download URL fancy_template-0.2.0-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4462eefd1c2f51a22828a188a058384927866341bce58084a312930bd0a306db
BLAKE2b-256 checksum
How to use checksums
44808d98f8ba1b631917f191c8a2369ad9d213d6ec6fa0c34607978ed5df8d68
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 27, 2026.

Transparency log

Security for fancy-template 0.2.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.2.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 27, 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