Metadata-Version: 2.4
Name: agi-gui
Version: 2026.6.19
Summary: AGILAB Streamlit UI dependency bundle and compatibility imports
Author: Jean-Pierre Morard
Maintainer: Jean-Pierre Morard
License-Expression: BSD-3-Clause
Project-URL: Documentation, https://thalesgroup.github.io/agilab
Project-URL: Source, https://github.com/ThalesGroup/agilab/tree/main/src/agilab/lib/agi-gui
Project-URL: Issues, https://github.com/ThalesGroup/agilab/issues
Project-URL: Homepage, https://github.com/ThalesGroup/agilab
Project-URL: Repository, https://github.com/ThalesGroup/agilab
Project-URL: Discussions, https://github.com/ThalesGroup/agilab/discussions
Project-URL: Changelog, https://github.com/ThalesGroup/agilab/releases
Keywords: agilab,streamlit,ui,pages,python
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
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: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: agi-env==2026.06.19
Requires-Dist: streamlit<1.58,>=1.57
Requires-Dist: starlette<2,>=1.0.1
Requires-Dist: streamlit_code_editor<0.2,>=0.1.22
Requires-Dist: watchdog<7,>=6
Dynamic: license-file

# AGI-GUI

[![PyPI version](https://img.shields.io/pypi/v/agi-gui.svg?cacheSeconds=300)](https://pypi.org/project/agi-gui/)
[![Python versions](https://img.shields.io/pypi/pyversions/agi-gui.svg)](https://pypi.org/project/agi-gui/)
[![License: BSD 3-Clause](https://img.shields.io/pypi/l/agi-gui)](https://opensource.org/licenses/BSD-3-Clause)
[![API docs](https://img.shields.io/badge/docs-agi--gui-brightgreen.svg)](https://thalesgroup.github.io/agilab/agi-gui.html)

`agi-gui` provides the UI dependency bundle for Streamlit pages. It depends on the headless `agi-env` runtime
and adds reusable page helpers and UI packages.

## Quick Install

```bash
pip install agi-gui
```

Use `agi-env` for worker/headless runtimes. Use `agi-gui` for Streamlit pages and local UI sessions.

## File Picker

`agi_gui.file_picker` provides a reusable Streamlit popover picker for pages that need server-side path selection
without exposing arbitrary filesystem access.

```python
from agi_gui.file_picker import agi_file_picker

selected_path = agi_file_picker(
    "Browse dataframe",
    roots={"Project": active_app_export_dir},
    key=f"{project_name}:dataframe_picker",
    patterns=["*.csv", "*.parquet", "*.json"],
    container=st.sidebar,
)
```

The picker validates manual paths and dataframe selections against the configured roots, keeps widget keys namespaced, and can optionally save uploaded files when the caller provides an explicit `upload_dir`.

## UX Widgets

`agi_gui.ux_widgets` provides small compatibility wrappers for newer Streamlit primitives. Pages can adopt modern controls while still running on older UI runtimes.

```python
from agi_gui.ux_widgets import compact_choice, status_container, toast

selected = compact_choice(
    st.sidebar,
    "Stages file",
    available_stages_files,
    key="index_page",
    default=available_stages_files[0],
)

with status_container(st, "Running pipeline...", state="running") as status:
    run_pipeline()
    status.update(label="Pipeline completed", state="complete")
    toast(st, "Pipeline completed", state="success")
```

`compact_choice` uses `st.segmented_control` or `st.pills` when available and falls back to `selectbox` for long lists or older Streamlit versions.

## Widget Registry

`agi_gui.widget_registry` provides a typed registry for reusable widgets. It gives pages and docs a single discovery point without breaking direct imports from `agi_gui.file_picker` or `agi_gui.ux_widgets`.

```python
from agi_gui import default_widget_registry, get_widget

registry = default_widget_registry()
rows = registry.as_rows()
file_picker = get_widget("file_picker")
same_picker = get_widget("agi_file_picker")
```

The default registry includes file selection, compact choice, action buttons, confirmation, status, empty-state, notice, and toast widgets.

## Repository

- Source: https://github.com/ThalesGroup/agilab/tree/main/src/agilab/lib/agi-gui
- Docs: https://thalesgroup.github.io/agilab/agi-gui.html
- Issues: https://github.com/ThalesGroup/agilab/issues
