Skip to main content

qweb-rs

A Rust port of Odoo's QWeb template engine and its template inheritance, for Python.

The goal is byte-identical output to Odoo's Python engine (Odoo 20), only faster. Every rendering rule, including whitespace handling, escaping, attribute order and error classes, follows the original implementation. Differential tests and fuzzers compare the two engines.

  • Rendering: 18x to 150x faster than ir_qweb.render(), and 7x to 17x faster with cached compilation.
  • Template inheritance: 2.1x faster than Odoo's lxml implementation.

Status: experimental. qweb_rs.render() and qweb_rs.apply_inheritance() work on their own. The full ir.qweb integration needs a patched Odoo 20, which is not public yet.

Install

pip install qweb-rs

Wheels are built for Linux (x86_64 and aarch64), macOS and Windows, for every CPython ≥ 3.12 (stable ABI). Other platforms build from the source distribution, which needs a Rust toolchain.

Usage

qweb_rs.render has the same signature as Odoo's database-less odoo.addons.base.models.ir_qweb.render:

from lxml import etree
import qweb_rs

templates = {
    "hello": '<t t-name="hello"><ul><li t-foreach="items" t-as="item" t-out="item"/></ul></t>',
}

def load(name):
    return etree.fromstring(templates[name]), name

qweb_rs.render("hello", {"items": ["a", "<b>"]}, load)
# Markup('<ul><li>a</li><li>&lt;b&gt;</li></ul>')

qweb_rs.apply_inheritance(
    '<t t-name="x"><p>hi</p></t>',
    ['<xpath expr="//p" position="after"><span>new</span></xpath>'],
)
# '<t t-name="x"><p>hi</p><span>new</span></t>'

qweb_rs.Engine keeps compiled templates in a cache. It is the API that the ir.qweb integration uses.

When Odoo is importable, errors are raised as Odoo's own QWebError.

License

LGPL-3.0-only, like the Odoo code it is ported from.

Odoo is a trademark of Odoo S.A. This project is not affiliated with or endorsed by Odoo S.A.

Metadata

Release files for qweb-rs 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 qweb-rs 0.2.0
File Size Uploaded Provenance Actions
qweb_rs-0.2.0.tar.gz 205.7 kB With provenance Details for qweb_rs-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for qweb-rs 0.2.0
File Actions
qweb_rs-0.2.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for qweb_rs-0.2.0-cp312-abi3-win_amd64.whl
qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details for qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl
qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl CPython 3.12 abi3 Linux musl 1.2+ ARM64 Details for qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl
qweb_rs-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for qweb_rs-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
qweb_rs-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for qweb_rs-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
qweb_rs-0.2.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for qweb_rs-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
qweb_rs-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for qweb_rs-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 5.5 MB

Release files / qweb_rs-0.2.0.tar.gz

Download URL qweb_rs-0.2.0.tar.gz
Size 205.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c0202602f6aee8a8627b44f71a4e2e1e9422ddd8f250aff9d2290a2bc9997f1e
BLAKE2b-256 checksum
How to use checksums
3f31a2c80d96f47fd9856736d20eb4abdd580d3f5a06f84510f47609f7a6200a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / qweb_rs-0.2.0-cp312-abi3-win_amd64.whl

Download URL qweb_rs-0.2.0-cp312-abi3-win_amd64.whl
Size 622.2 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2a84734c5ca3a50082b1f1522c6e80c96cf8749fac987d1cada36e8fa6a1ca2f
BLAKE2b-256 checksum
How to use checksums
1e2d6ac9b99cd71a319a6700ec6834ee81bb2919da1a968020c06b496d52eab0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 937.0 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
ec892524e0749ea7550919449b9b1eed698122afc63f208a7ddb22dd01264a42
BLAKE2b-256 checksum
How to use checksums
ea0becc92abc9f6c6383e6fdd43a9f717944f41f40211557fa9388f5c6f18c56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl

Download URL qweb_rs-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl
Size 884.5 kB
Tags CPython 3.12 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
d8951be15e473930d87368c84688a7b808801bbda8a36fc9c1043e8a63ed23d6
BLAKE2b-256 checksum
How to use checksums
bd2c574f7c941dfe4bdb64a45ea4495f7a4292c12b5f1b14b905aff91fc49342
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / qweb_rs-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL qweb_rs-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 726.3 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8257cf25772b1c28358a296167383cfd3a9f83d637297bf4cf48d6384d56c69d
BLAKE2b-256 checksum
How to use checksums
8c26a01f4358fcaec621c794fceef66a8ef064eb0569df7c601038d041147f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / qweb_rs-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL qweb_rs-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 706.1 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c33700f13ca3456fc0a54809c1c1680a800a0b90921d343128733dc5b753d207
BLAKE2b-256 checksum
How to use checksums
fab25a68be8a24560e2dc9bdc07a28f026dc3ecb20ce033307034ed7e94c0b66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / qweb_rs-0.2.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL qweb_rs-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Size 665.8 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f0760c0fc1c79870c5e8549162464e43118b8bfb8dc01e45db75a07fbb3761b9
BLAKE2b-256 checksum
How to use checksums
f0aba3cb83b8dc2c92346d3abebb46e87835d6b8630672b4770beb3d5f313945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / qweb_rs-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL qweb_rs-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 704.3 kB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
adbadef13a223e39ff121f42cca9618a52618f06084e79e514dd3748e2806adf
BLAKE2b-256 checksum
How to use checksums
ef99b971f80e07efeb5a9f769679b823ae2f6940863c7d6ba92b5b0b3206a7cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for qweb-rs 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

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for qweb_rs-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 Nov 19, 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

8 release files Full 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