Skip to main content

nyxa-minijinja

Rust (PyO3) MiniJinja backend for nyxa-view — renders translated .pyt templates at native speed while preserving the Python reference engine's exact semantics. Bundled with nyxa and the default backend — view.engine = "nyxa" opts back to the pure-Python engine.

Features

  • Engine pyclass — a MiniJinja environment holding translated templates: add_template, remove_template, has_template, render. Default nyxa-view backend when installed — selected automatically through the backend registry (MinijinjaBackend); view.engine = "nyxa" pins the pure-Python engine instead.
  • Python-faithful semantics — templates are rendered through __nyxa_*__ leaf hooks (escaping, truthiness, attribute/subscript access, binary/unary ops, calls, iteration, f-strings) so {{ }} semantics match the reference compiler — including Python's html.escape quoting and None printing rules.
  • PyObj bridging — arbitrary Python objects cross the boundary lazily: attribute access, method calls, truthiness, and iteration delegate back to Python under the GIL; scalars/str-keyed dicts/sequences convert eagerly with a bounded depth (deep structures raise instead of overflowing).
  • Leaf-hook safety — the __nyxa_*__ machinery is re-asserted after user context each render, so a context key can never shadow escaping or other runtime behavior.
  • Re-entrant render — unsendable engine; parent/include hooks may re-enter render/add_template recursively without borrow conflicts.
  • RenderError — template and render failures surface as a dedicated exception type.

Install

pip install nyxa            # nyxa-minijinja is bundled by default
# standalone: nyxa add nyxa-minijinja

Requires a compiled wheel (maturin build) — when unavailable, the nyxa-view backend factory returns None and rendering uses the pure-Python compiler path.

Usage

No config needed — with the wheel installed, nyxa-view uses the Rust backend by default:

# config/view.py
config = {
    "paths": ["resources/views"],
    "cache": "build/views",
    # "engine": "nyxa",    # opt out — pin the pure-Python engine
}

NYXA_NO_NATIVE_TEMPLATES/NYXA_NO_SPEEDUPS env vars also force the Python engine.

Direct use (rare — nyxa-view drives it for you):

import nyxa_minijinja

engine = nyxa_minijinja.Engine()
engine.add_template("hello", "Hello, {{ name }}!")
out = engine.render("hello", {"name": "Ain"}, {})

Public API

  • Engine — Engine(builtins=None); builtins is a dict of Python callables exposed as template globals.
    • engine.add_template(name, source) — register (or replace) a translated Jinja source.
    • engine.remove_template(name) — drop a template.
    • engine.has_template(name) -> bool — whether name is registered.
    • engine.render(name, ctx, hooks) -> str — render with a context dict plus per-render hooks (callables used by the translator's emitted code). Raises RenderError.
  • RenderError — exception raised for template registration and render failures.

Configuration

Selected via nyxa-view's view.engine config (see nyxa-view README). No config of its own.

License

MIT

Metadata

Release files for nyxa-minijinja 0.0.1

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

Source distribution (sdist)

Source distribution for nyxa-minijinja 0.0.1
File Size Uploaded Provenance Actions
nyxa_minijinja-0.0.1.tar.gz 12.7 kB Without provenance Details for nyxa_minijinja-0.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nyxa-minijinja 0.0.1
File Actions
nyxa_minijinja-0.0.1-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details for nyxa_minijinja-0.0.1-cp313-abi3-win_amd64.whl
nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 abi3 Linux glibc 2.17+ x86-64 Details for nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.13 abi3 Linux glibc 2.17+ ARM64 Details for nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
nyxa_minijinja-0.0.1-cp313-abi3-macosx_11_0_arm64.whl CPython 3.13 abi3 macOS 11.0+ ARM64 Details for nyxa_minijinja-0.0.1-cp313-abi3-macosx_11_0_arm64.whl
nyxa_minijinja-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl CPython 3.13 abi3 macOS 10.12+ x86-64 Details for nyxa_minijinja-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl

Total release size: 4.2 MB

Release files / nyxa_minijinja-0.0.1.tar.gz

Download URL nyxa_minijinja-0.0.1.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
35dba1826c348b4d20441e3caaa5c1def2ad238957b669b378424272be330f2d
BLAKE2b-256 checksum
How to use checksums
20d871010c5e711d48e05dc9abb317c4a5138a0a9c5d3a9cc4af2d250008e6a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_minijinja-0.0.1-cp313-abi3-win_amd64.whl

Download URL nyxa_minijinja-0.0.1-cp313-abi3-win_amd64.whl
Size 765.5 kB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8469c5fea2f8fbf51adfc5701eb08a0b1963752bd58befda53851aaae2de139b
BLAKE2b-256 checksum
How to use checksums
e49b9a6df6205f6dbc488432a5326262be08b265a0296114f97398f1171f45fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 895.3 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
fba9282eeb62d887098454b1673d42322623f8b1c34ca85de8896610e6df63a2
BLAKE2b-256 checksum
How to use checksums
8a802816cb6e6c59e99a2c9d9c3c5c9ed3c705b3537aa6ae919cbd281ed18b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL nyxa_minijinja-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 875.5 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b8f754b88f2f2a5003edc4a8323ad6aa9803588397f329d2d8815bfbbf6424ab
BLAKE2b-256 checksum
How to use checksums
370ff47b6d204d2bc0c85287c400fe4ba51599a152a2fa5b5cbf2c70a4833fea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_minijinja-0.0.1-cp313-abi3-macosx_11_0_arm64.whl

Download URL nyxa_minijinja-0.0.1-cp313-abi3-macosx_11_0_arm64.whl
Size 819.2 kB
Tags CPython 3.13 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bb55f2c6029abe407470ea99cc55df822c28651c92f490627173441674a44228
BLAKE2b-256 checksum
How to use checksums
b1ae6eb499e8248d22acbcf1ad7d01b6e993408d0afed0d0c7e63ac59c68acf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_minijinja-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl

Download URL nyxa_minijinja-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl
Size 867.3 kB
Tags CPython 3.13 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
69e6d93894f33436321e1af6ccdd22e8b39393b39fb9948fe05da02c33981e7e
BLAKE2b-256 checksum
How to use checksums
bb68656e037fd5a02126155f6a82e84053738704ab0a75a08b55349aa3486a5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for nyxa-minijinja 0.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

6 release files No provenance

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