Metadata-Version: 2.5
Name: gramlot
Version: 0.1.0a1
Summary: Declarative web UI framework describing interfaces in Python as Live Object Trees
Project-URL: Homepage, https://gramlot.com
Project-URL: Repository, https://github.com/genropy/gramlot
Project-URL: Issues, https://github.com/genropy/gramlot/issues
Author-email: Genropy Team <info@softwell.it>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: genro-bag<0.22,>=0.21.1
Requires-Dist: genro-builders>=0.23.2
Requires-Dist: genro-toolbox>=0.14.0
Requires-Dist: genro-tytx[msgpack]>=0.15.0
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.115; extra == 'fastapi'
Requires-Dist: uvicorn>=0.30; extra == 'fastapi'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
Description-Content-Type: text/markdown

# Gramlot

<img src="https://raw.githubusercontent.com/genropy/gramlot/main/assets/gramlot-logo.png" alt="Gramlot logo" width="180">

**GRAMmar for Live Object Trees**

Describe interfaces in Python and render them with the Gramlot JavaScript runtime.
The first alpha includes typed Source transport, widgets and an optional FastAPI
integration with automatic page discovery.

## FastAPI integration

Create `pages/hello.py` in your application directory:

```python
from genro_toolbox import metadata
from gramlot.page import WebPage

@metadata(title="Hello")
class Page(WebPage):
    """Display a greeting."""

    def main(self, root):
        root.h1("Hello World")
```

With Gramlot and its FastAPI extra installed:

```sh
gramlot fastapi serve /path/to/my_app
```

Open `http://127.0.0.1:8000/page/`. No `main.py` or JSON registry is required.
For custom servers, use `GramlotApplication` or `mount_gramlot` from
`gramlot.contrib.fastapi`. More integrations coming soon.

## Documentation

- [Getting started](docs/source/guide/first-page.rst)
- [FastAPI integration](docs/source/guide/fastapi.rst)
- [Pages and reserved metadata](docs/source/reference/pages.rst)
- [Documentation development](docs/development/building-docs.rst)

Alpha candidate `0.1.0a1` is prepared for its first release. For local installation,
build a wheel and install it with the `[fastapi]` extra. See
[build and release instructions](docs/release.md).

## Development

```sh
npm --prefix js/dom ci --ignore-scripts
python scripts/prepare_assets.py
python scripts/prepare_test_client.py
python -m pip install '.[test,fastapi]' httpx
GRAMLOT_CLIENT_MODULES="$PWD/build/test-client" python -m pytest -q
npm --prefix js/dom test
```

Documentation builds independently from runtime packages. See `docs/requirements.txt`.
Gramlot is licensed under Apache 2.0.
