Metadata-Version: 2.2
Name: unbrowsed
Version: 0.1.0a4
Summary: A browserless HTML testing library for Python
Author-email: Valentino Gagliardi <valentino@valentinog.com>
License: MIT License
        
        Copyright (c) 2025 Valentino Gagliardi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/username/unbrowsed
Project-URL: Bug Tracker, https://github.com/username/unbrowsed/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: selectolax>=0.3.28
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"

# Unbrowsed

A browserless HTML testing library for Python, inspired by [testing-library](https://testing-library.com/).

## Overview

Unbrowsed allows you to test HTML without spawning a browser. It provides a simple, intuitive API for querying HTML elements similar to testing-library's approach, encouraging accessible and maintainable tests.

## Features

- Fast HTML parsing using [selectolax](https://github.com/rushter/selectolax)
- Browser-free testing of HTML content
- Query functions that encourage accessible testing practices
- Simple, Pythonic API

## Installation

```bash
pip install unbrowsed
```

## Usage

### Basic Example

```python
from unbrowsed import parse_html, query_by_label_text

# Parse HTML content
html = """
<form>
    <label for="username">Username</label>
    <input id="username" type="text">
    <label for="password">Password</label>
    <input id="password" type="password">
    <button type="submit">Login</button>
</form>
"""
dom = parse_html(html)

# Query elements by label text
username_input = query_by_label_text(dom, "Username")
assert username_input is not None
```

## Development

### Setup

```bash
# Clone the repository
git clone https://github.com/username/unbrowsed.git
cd unbrowsed

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[test]"
```

### Running Tests

```bash
pytest
```

### Releasing a New Version

To release a new version:

1. Update the version in `pyproject.toml`
2. Create and push a new tag:

```bash
git tag v0.1.0  # Use appropriate version
git push origin v0.1.0
```

This will trigger the CI pipeline to build and publish the package to PyPI automatically.

## License

MIT
