Skip to main content

Python runtime for the @barefootjs/jinja adapter

Project description

barefootjs

Python runtime for BarefootJS marked templates, targeting Jinja2.

BarefootJS is a fine-grained reactive TSX compiler: you write components in TSX, and the compiler emits templates for your backend's template engine plus the client-side JS that hydrates them. This package is the server half for Python — it renders the .jinja templates produced by the @barefootjs/jinja adapter.

Installation

pip install barefootjs

The only dependency is jinja2; everything else is stdlib.

Quick start

Generated .jinja templates call the BarefootJS instance as a bf object ({{ bf.scope_attr() }}, {{ bf.json(x) }}, {{ bf.spread_attrs(bag) }}):

from barefootjs import BarefootJS, JinjaBackend

backend = JinjaBackend(paths=["templates"])
bf = BarefootJS(None, {"backend": backend})
html = backend.render_named("counter", bf, {"count": 0})

Package layout

Module Role
runtime.py the engine-agnostic bf object
evaluator.py ParsedExpr evaluator for the *_eval helpers
search_params.py searchParams() SSR reader
backend_jinja.py the Jinja2 engine backend

Documentation

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

barefootjs-0.23.0.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

barefootjs-0.23.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file barefootjs-0.23.0.tar.gz.

File metadata

  • Download URL: barefootjs-0.23.0.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for barefootjs-0.23.0.tar.gz
Algorithm Hash digest
SHA256 2f5f2cc990a6d3d687de9f843e13ea4831834a38b5c618b2d7c75dfabb1544c9
MD5 2cd1e442ff6479cbd5574c3a740bde92
BLAKE2b-256 8fd85350713a334be58957757c6e6fb86af9a9ea93f5ef886e545a84766355d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for barefootjs-0.23.0.tar.gz:

Publisher: release.yml on piconic-ai/barefootjs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file barefootjs-0.23.0-py3-none-any.whl.

File metadata

  • Download URL: barefootjs-0.23.0-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for barefootjs-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd0573358a5b0ee17dfb5682bd9f20c47e08f9660fd7b978df97c8c1bb330a5c
MD5 a18e3acf82f26222778243c0d42c9134
BLAKE2b-256 72eb04e1e19141abd7ae402c37b0184d92a7211ba9ffff04010df59c4de5d253

See more details on using hashes here.

Provenance

The following attestation bundles were made for barefootjs-0.23.0-py3-none-any.whl:

Publisher: release.yml on piconic-ai/barefootjs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page