Skip to main content

pitbull

pitbull lets ordinary, JavaScript-free HTML talk to Python while rendered in PyQt5 WebEngine (Chromium). It maps normal relative links and GET form submissions to Python functions in-process: no localhost server, browser automation driver, JavaScript, or custom URL syntax in your HTML.

Install

pip install pitbull

PyQt5 WebEngine is installed automatically as a package dependency.

Example

from pathlib import Path
from pitbull import App

app = App(Path("web"), title="Hello")

@app.event("greet")
def greet(request):
    name = request.form.get("name", "friend")
    return app.render("index.html", message=f"Hello, {name}!")

app.run()

JavaScript toggle

JavaScript is disabled by default. Opt in at startup with App(Path("web"), javascript_enabled=True), or change it at runtime:

app.set_javascript_enabled(True)  # Reloads the current page by default.

To preserve the JavaScript-free model, only enable it for pages you trust.

web/index.html needs no JavaScript:

<!doctype html>
<title>Hello</title>
<form action="/greet" method="get">
  <label>Name <input name="name" required></label>
  <button>Greet</button>
</form>
<p>{{ message }}</p>

Security model

Pitbull has no listening socket. It creates an internal renderer-only URL scheme and restricts static files to web_root. Templates escape values supplied to app.render; do not put untrusted input directly into raw HTML strings returned from a handler.

Plain HTML constraint

Use ordinary relative links and GET forms. For example, action="/greet" calls @app.event("greet"), and href="/settings.html" opens a file in web_root. PyQt5 does not reliably expose POST form bodies through its navigation callback, so use method="get" for Python events. No pitbull:// URL needs to appear in authored HTML.

Scope

JavaScript is disabled through Chromium's managed content setting. This does not produce a custom Chromium binary with V8 physically removed. Building and maintaining such a browser is a separate Chromium-fork project, not something a normal PyPI wheel can safely distribute.

Metadata

Release files for pitbull 0.2.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 pitbull 0.2.1
File Size Uploaded Provenance
pitbull-0.2.1.tar.gz 9.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pitbull 0.2.1
File Interpreter ABI Platform
pitbull-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / pitbull-0.2.1.tar.gz

Download URL pitbull-0.2.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3f931329044210883f63edc274eabf4ed027b47654bac86c4bc249fcfebfae06
BLAKE2b-256 checksum
How to use checksums
28bbc82cba94beee9e4daa75204c83733065416e725b8b809b9f16b6164d3f7e
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 Oct 24, 2026.

Transparency log

Release files / pitbull-0.2.1-py3-none-any.whl

Download URL pitbull-0.2.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df33385a7161418c6f4cf24a6d5c1bcc1734633bc81b1456cb4ec8993414b861
BLAKE2b-256 checksum
How to use checksums
511316a820fd40930020012a5f13af1b38f4dc3816f19e9664bdf619a26fdbae
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 Oct 24, 2026.

Transparency log

Security for pitbull 0.2.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.

Full provenance

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

Select from 2 files

Attestation for pitbull-0.2.1.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 24, 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.1 This release

2 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