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.7.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.7-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for miniclient-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ca2f0b3ac0b6f22df781077e51648554c83f91b21abf861f06c1d8c89a6e8356
MD5 0608fb7ce3308aa1f2d532c7f0bcc6b6
BLAKE2b-256 622a526d94a4236e6c40a163e0f88068218ef07eb978aaa74d2afa85f313a9f4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: miniclient-0.0.7-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.12

File hashes

Hashes for miniclient-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cd1f19824e1cd085f5f6b45825a39c57c40bf0c185c778dfdb99ccd25766c4b7
MD5 b914a256499dbbf9d583420baf98c66d
BLAKE2b-256 e4008c4f8f5b0835e9ee3c3d3994e82624226ef0dc858dbfd77310cad3190726

See more details on using hashes here.

Provenance

The following attestation bundles were made for miniclient-0.0.7-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