Metadata-Version: 2.5
Name: anywidget-bundle
Version: 0.1.1
Summary: Load Vite-built anywidget modules from Python.
Project-URL: Documentation, https://peter-gy.github.io/anywidget-bundle/
Project-URL: Issues, https://github.com/peter-gy/anywidget-bundle/issues
Project-URL: Source, https://github.com/peter-gy/anywidget-bundle
Author-email: Peter Ferenc Gyarmati <dev.petergy@gmail.com>
Maintainer-email: Peter Ferenc Gyarmati <dev.petergy@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: anywidget,jupyter,marimo,vite,widgets
Classifier: Framework :: Jupyter
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: anywidget>=0.11.0
Provides-Extra: build
Requires-Dist: hatchling>=1.31; extra == 'build'
Description-Content-Type: text/markdown

# anywidget-bundle

`anywidget-bundle` loads a manifest-backed Vite build into an anywidget model. It embeds the lean bootstrap in `_esm`, resolves optional CSS, and serves allowlisted JavaScript chunks from the consumer wheel.

```sh
uv add anywidget-bundle
```

```python
from pathlib import Path

from anywidget_bundle import Bundle, BundledWidget


class WeatherWidget(BundledWidget):
    bundle = Bundle(Path(__file__).parent / "static")
```

Package the complete generated `static` directory with the widget. It contains `anywidget.json`, the bootstrap, and every module Python may serve.

Use the `anywidget-bundle` Hatch build hook to validate that directory during packaging. Observe `widget.bundle_status` for browser loading and lifecycle failures, including errors raised before the application loads.

See the [documentation](https://peter-gy.github.io/anywidget-bundle/) for the build and Python APIs.
