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.19.1.tar.gz (50.5 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.19.1-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for barefootjs-0.19.1.tar.gz
Algorithm Hash digest
SHA256 9b2b6a67bd7a960dd97fafce9e554697e9312a849794817dfb03bcca8b0665b5
MD5 5b107dc09619afac8f069812c7afdb2c
BLAKE2b-256 510c84af5de265405c53c7a7dfd91ce0438ad1364acefa8faa09cafd69f51332

See more details on using hashes here.

Provenance

The following attestation bundles were made for barefootjs-0.19.1.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.19.1-py3-none-any.whl.

File metadata

  • Download URL: barefootjs-0.19.1-py3-none-any.whl
  • Upload date:
  • Size: 34.3 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.19.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2ce54332c44b584c3d6f7a5dc846ef0f464f651273a71d396ea796f03d81bfd
MD5 2c6e05f7bf89c8dc6dfc8e40acce3f23
BLAKE2b-256 3d1946552203bcf5a8893b69ef569bb65777895025091bc56942333c69a41145

See more details on using hashes here.

Provenance

The following attestation bundles were made for barefootjs-0.19.1-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