Metadata-Version: 2.2
Name: weba
Version: 0.2.25
Summary: html framework
Author-email: CJ Lazell <cjlazell@gmail.com>
Project-URL: Homepage, https://cj.github.io/weba/
Project-URL: Repository, https://github.com/cj/weba
Project-URL: Documentation, https://cj.github.io/weba/
Keywords: weba,htmx,python
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <=3.13,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beautifulsoup4>=4
Requires-Dist: types-beautifulsoup4>=4

# weba

[![Release](https://img.shields.io/github/v/release/cj/weba)](https://img.shields.io/github/v/release/cj/weba)
[![Build status](https://img.shields.io/github/actions/workflow/status/cj/weba/main.yml?branch=main)](https://github.com/cj/weba/actions/workflows/main.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/cj/weba/branch/main/graph/badge.svg)](https://codecov.io/gh/cj/weba)
[![Commit activity](https://img.shields.io/github/commit-activity/m/cj/weba)](https://img.shields.io/github/commit-activity/m/cj/weba)
[![License](https://img.shields.io/github/license/cj/weba)](https://img.shields.io/github/license/cj/weba)

Weba is a Python library for building web user interfaces using a declarative,
component-based approach. It provides a clean API for creating HTML elements and
components with proper context management and type safety. The library extends
BeautifulSoup's functionality by adding a custom Tag class that supports modern web
development patterns, including HTMX integration, class list manipulation, and
comment-based selectors. It allows developers to create reusable UI components with
proper isolation, supports both synchronous and asynchronous contexts, and handles
attribute management (including JSON serialization) elegantly. The library emphasizes
type safety and follows clean code practices, making it particularly suitable for
building modern web applications in Python with a focus on maintainability and developer
experience.

## Configuration

The library supports the following environment variables for configuration:

- `WEBA_LRU_CACHE_SIZE`: Controls the maximum size of the LRU cache used for storing parsed HTML templates and file contents. Defaults to 128. Example:

```bash
export WEBA_LRU_CACHE_SIZE=256  # Increase cache size to 256 entries
```

- **Github repository**: <https://github.com/cj/weba/>
- **Documentation** <https://weba.cj.io/>
