Metadata-Version: 2.4
Name: pluggle-interface-streamlit
Version: 0.1.0
Summary: Browser-based dashboard for Pluggle — run and inspect ETL pipelines interactively, powered by Streamlit.
Author: hsnwhte
License: MIT
Project-URL: Homepage, https://pluggle.org
Project-URL: Repository, https://github.com/hsnwhte/pluggle-interface-streamlit
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pluggle>=0.13.0
Requires-Dist: streamlit>=1.62
Provides-Extra: dev
Requires-Dist: ruff>=0.16; extra == "dev"
Dynamic: license-file

# pluggle-interface-streamlit

A browser-based dashboard for [Pluggle](https://pluggle.org) — run and inspect ETL
pipelines interactively, powered by Streamlit.

Pluggle is a plugin-based ETL/sync engine with a CLI and a programmatic API. This
package adds a third way to drive it: a local web interface where you can configure a
pipeline, run it, and manage installed transform strategies without touching the command
line.

It is a one-way consumer of Pluggle — Pluggle has no knowledge of this package and does
not discover it at runtime. Everything goes through Pluggle's declared public interface
(`pluggle.interfaces.api`), never through its internals.

## Install

```bash
pip install pluggle-interface-streamlit
```

Pluggle is pulled in as a dependency. Python 3.14 or newer is required.

For local development:

```bash
git clone https://github.com/hsnwhte/pluggle-interface-streamlit
cd pluggle-interface-streamlit
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
```

## Running

```bash
streamlit run src/pluggle_interface_streamlit/app.py
```

The app opens at `http://localhost:8501`.

Run this from the project root. The working directory determines where `data/`
is created and where the theme in `.streamlit/config.toml` is read from.

## Pages

**Run** — configure and execute a pipeline. Mirrors the CLI's `run` command:
source and target type (file, db, api), addresses, table names for database endpoints,
the transform strategy, and the output format. The target address is prefilled with a
timestamped path under `data/outputs/` when the target is a file.

**Strategies** — browse the curated
[pluggle-strategies](https://github.com/hsnwhte/pluggle-strategies) catalog, read a
strategy's README before installing it, install from the catalog or from a local `.py`
file, and remove installed strategies. The built-in
`default_v1.0` passthrough strategy cannot be removed.

## Configuration

All runtime data — the SQLite store, installed strategies, logs, uploads and pipeline
outputs — is created under a `data/` folder in the directory you run the app from.

Log output is fixed to `data/logs` by this package so that every runtime artifact sits
in one place; it is not configurable.

The remaining Pluggle paths can be overridden with a `.env` file in your working
directory:

```env
PLUGGLE_STORE_ADDRESS=sqlite:///data/runtime.sqlite
PLUGGLE_STRATEGIES_DIR=data/strategies
```

Pluggle reads these via `os.environ.get(...)` at import time, so no code changes are
needed.

SQLite is the default store and is sufficient here: this is a single-user local tool
with none of the concurrent-write exposure that would call for PostgreSQL.

### Theme

Colours come from `.streamlit/config.toml` in the working directory. Streamlit exposes
five theme variables; edit `primaryColor` to change the accent used by buttons, selected
rows, and links.

## Project layout

```
src/pluggle_interface_streamlit/
├── app.py              # landing page
├── settings.py         # package paths (assets, uploads, outputs)
├── assets/             # logo and icon
└── pages/
    ├── 1_Run.py
    └── 2_Strategies.py
```

`settings.py` distinguishes two roots: `PACKAGE_ROOT` for files shipped with the package
(assets), and `RUNTIME_ROOT` (`Path.cwd()`) for anything created while running.
Pluggle's own `settings.py` handles the `mkdir` calls for its directories on import, so
there is no bootstrap step.

## Scope

This package is a generic interface — it runs whatever strategies you have installed and
makes no assumptions about your data. It is not a hosted service; for a deployed demo of
Pluggle, see
[pluggle.org](https://pluggle.org).

There are no automated tests. Almost nothing here is more than a Streamlit widget call
or a thin pass through to `pluggle.interfaces.api`; the engine's own test suite covers
the logic, and Streamlit's `AppTest` would be brittle against any widget reordering.
Both pages are verified manually end to end.

## License

MIT
