Metadata-Version: 2.5
Name: kavacha
Version: 0.0.2
Summary: run and package web apps as native desktop applications
Project-URL: Repository, https://github.com/vedicreader/kavacha
Project-URL: Documentation, https://vedicreader.github.io/kavacha
Author-email: Karthik Rajgopal <karthik.rajgopal@hotmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: desktop,packaging,py2app,py2exe,pywebview
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Requires-Dist: fastcore>=1.8.17
Provides-Extra: icons
Requires-Dist: pillow>=10.0; extra == 'icons'
Provides-Extra: macapp
Requires-Dist: pillow>=10.0; extra == 'macapp'
Requires-Dist: py2app>=0.28.8; (sys_platform == 'darwin') and extra == 'macapp'
Requires-Dist: pyobjc-framework-cocoa>=10.1; (sys_platform == 'darwin') and extra == 'macapp'
Requires-Dist: pyobjc-framework-webkit>=10.1; (sys_platform == 'darwin') and extra == 'macapp'
Requires-Dist: pythonnet>=3.0.3; (sys_platform == 'win32') and extra == 'macapp'
Requires-Dist: pywebview>=5.3; extra == 'macapp'
Provides-Extra: window
Requires-Dist: pyobjc-framework-cocoa>=10.1; (sys_platform == 'darwin') and extra == 'window'
Requires-Dist: pyobjc-framework-webkit>=10.1; (sys_platform == 'darwin') and extra == 'window'
Requires-Dist: pythonnet>=3.0.3; (sys_platform == 'win32') and extra == 'window'
Requires-Dist: pywebview>=5.3; extra == 'window'
Provides-Extra: windows
Requires-Dist: pillow>=10.0; extra == 'windows'
Requires-Dist: py2exe>=0.14.2; (sys_platform == 'win32') and extra == 'windows'
Requires-Dist: pyobjc-framework-cocoa>=10.1; (sys_platform == 'darwin') and extra == 'windows'
Requires-Dist: pyobjc-framework-webkit>=10.1; (sys_platform == 'darwin') and extra == 'windows'
Requires-Dist: pythonnet>=3.0.3; (sys_platform == 'win32') and extra == 'windows'
Requires-Dist: pywebview>=5.3; extra == 'windows'
Description-Content-Type: text/markdown

# kavacha


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install kavacha
pip install "kavacha[window]"
pip install "kavacha[macapp]"
pip install "kavacha[windows]"
```

The extras add native-window support and platform freezer dependencies.

## Describe the app

``` python
from kavacha import App, tree, doc_types, mypyc_modules

app = App(
    name='Demo',
    entry='demo_app.py',
    version='1.2.3',
    icon='assets/Demo.icns',
    packages=['demo', 'fasthtml', 'uvicorn', 'numpy'],
    includes=['demo.cli', *mypyc_modules()],
    grafted=['apsw', 'playwright'],
    data=tree('demo/static', 'demo/static'),
    extras=['desktop'],
    doc_types=doc_types(['.py', '.rs', '.md']),
)
app.py2app_options()
```

One [`App`](https://vedicreader.github.io/kavacha/spec.html#app) specification supplies both platform freezers. Explicit packages and modules cover imports a freezer cannot discover.

## Build

``` python
from kavacha import build, check

check(app, root)
build(app, root, setup_py='packaging/macos/setup.py')
```

[`build`](https://vedicreader.github.io/kavacha/build.html#build) uses a compatible interpreter, installs pinned requirements from `uv.lock`, refuses to replace a running bundle unless forced, and records the source commit.

## After freezing

``` python
from kavacha import finish

finish(bundle, app)
```

[`finish`](https://vedicreader.github.io/kavacha/bundle.html#finish) grafts archive-incompatible packages, removes unreachable archive copies, links duplicate files, and installs the modern icon before signing.

## Icons

``` python
from kavacha.icons import icons_for

icons_for('assets/logo.png', 'assets', 'Demo')
```

A square image of at least 512 pixels produces platform and web icon assets. Invalid sources are rejected rather than upscaled.

## Window

``` python
from kavacha.window import run_shell, shell_ready

ok, why = shell_ready()
run_shell('http://127.0.0.1:8000', title='Demo', size='1440x900')
```

[`run_shell`](https://vedicreader.github.io/kavacha/window.html#run_shell) opens a pywebview window over a loopback server. The host supplies menus and workspace callbacks.

## Status

The spec, build driver, bundle surgery and icons are covered by tests that run anywhere. The window
and menus are ported working code, but the platform they matter on is not one CI can exercise here
— treat that module as needing a real run on macOS before you rely on it.
