Skip to main content

A minimal python http client that runs real JS/DOM (htmx and friends) without a browser

Project description

miniclient

CI codecov Docs PyPI Python versions License

A minimal python http client that runs JavaScript, without a browser. Meant to be used as a lightweight test client to simulate browser interactions. Embeds a V8 Runtime, DOM, and is designed to run htmx especially well.

Install

uv add miniclient

Example

The snippet below opens a page, submits a search form, clicks a "load more" button and reads the results back. All against a real in-memory DOM running JavaScript (htmx, for example). No browser involved.

from miniclient.browser import Browser

with Browser() as browser:
    browser.goto("http://localhost:8000/")
    browser.find("input[name=q]").fill("htmx")
    browser.find("form").requestSubmit()
    browser.find("#load-more").click()
    print(len(browser.find_all("#results li")), "results")
    print(browser.find("#results li:first-child").text)

Check the full documentation: https://marciomazza.github.io/miniclient/

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

miniclient-0.0.8.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

miniclient-0.0.8-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file miniclient-0.0.8.tar.gz.

File metadata

  • Download URL: miniclient-0.0.8.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for miniclient-0.0.8.tar.gz
Algorithm Hash digest
SHA256 e3ce2a32204277413c0aef8600c474771eece59f3d2ecb143bd8303fc5acc357
MD5 239efb5dbb6c21def0a3d1fe1d6440b4
BLAKE2b-256 4931578790d84b99421b36dd68335eca951a871b78c3a66ab191cb8276fa29ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for miniclient-0.0.8.tar.gz:

Publisher: release.yml on marciomazza/miniclient

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

File details

Details for the file miniclient-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: miniclient-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for miniclient-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ed887ad642b766ceccea44996d5192b9e501abc888435055a510ec5146799599
MD5 bcc02b7231a456af62e0054a24e295e3
BLAKE2b-256 3b31948171e700d93c1b5290f2fe62ccd1226a3c9f899c4a6e75ce07929b6fc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for miniclient-0.0.8-py3-none-any.whl:

Publisher: release.yml on marciomazza/miniclient

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