Metadata-Version: 2.4
Name: weba
Version: 0.2.31
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: charset-normalizer>=3.4.0
Requires-Dist: types-beautifulsoup4>=4
Dynamic: license-file

# 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 caching of parsed HTML templates and file contents:
  - When set: Enables LRU caching with the specified maximum size
  - When not set: Disables caching, templates and files are re-read on every access

Example:

```bash
export WEBA_LRU_CACHE_SIZE=256  # Enable caching with max 256 entries
unset WEBA_LRU_CACHE_SIZE      # Disable caching completely
```

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