Metadata-Version: 2.4
Name: miniclient
Version: 0.0.6
Summary: A minimal python http client that runs real JS/DOM (htmx and friends) without a browser
Project-URL: Homepage, https://github.com/marciomazza/miniclient
Project-URL: Repository, https://github.com/marciomazza/miniclient
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.14
Requires-Dist: httpx2~=2.6.0
Requires-Dist: jsrun~=0.1.0
Description-Content-Type: text/markdown

# miniclient

[![CI](https://github.com/marciomazza/miniclient/actions/workflows/ci.yml/badge.svg)](https://github.com/marciomazza/miniclient/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/marciomazza/miniclient/graph/badge.svg)](https://codecov.io/gh/marciomazza/miniclient)
[![Docs](https://github.com/marciomazza/miniclient/actions/workflows/docs.yml/badge.svg)](https://marciomazza.github.io/miniclient/)
[![PyPI](https://img.shields.io/pypi/v/miniclient)](https://pypi.org/project/miniclient/)
[![Python versions](https://img.shields.io/pypi/pyversions/miniclient)](https://pypi.org/project/miniclient/)
[![License](https://img.shields.io/github/license/marciomazza/miniclient)](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](https://htmx.org) especially well.

## Install

```bash
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.

```python
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/>
