Metadata-Version: 2.5
Name: ldaca-wordflow
Version: 0.7.2
Summary: LDaCA Wordflow - FastAPI backend with bundled production frontend for the Language Data Commons of Australia
Project-URL: Homepage, https://github.com/Australian-Text-Analytics-Platform/ldaca-wordflow
Project-URL: Repository, https://github.com/Australian-Text-Analytics-Platform/ldaca-wordflow
Project-URL: Documentation, https://github.com/Australian-Text-Analytics-Platform/ldaca-wordflow/tree/main/docs
Author: Australian Text Analytics Platform
License: MIT
Keywords: corpus,fastapi,ldaca,linguistics,text-analytics,web-app
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.14
Requires-Dist: aiosqlite>=0.21.0
Requires-Dist: anthropic>=0.40.0
Requires-Dist: duckdb>=1.4.0
Requires-Dist: fastapi>=0.138.0
Requires-Dist: fastexcel>=0.18.0
Requires-Dist: google-auth[requests]>=2.38.0
Requires-Dist: google-genai>=1.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: openai>=2.26.0
Requires-Dist: polars-source-utils>=0.2.0
Requires-Dist: polars-text>=0.5.0
Requires-Dist: psutil>=6.1.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: python-multipart>=0.0.20
Requires-Dist: rtoml>=0.12.0
Requires-Dist: spacy>=3.7.0
Requires-Dist: tbb>=2022.3.1; sys_platform != 'darwin'
Requires-Dist: tzdata>=2025.2; sys_platform == 'win32'
Requires-Dist: uvicorn[standard]>=0.35.0
Provides-Extra: deploy
Requires-Dist: ipython>=9.5.0; extra == 'deploy'
Requires-Dist: jupyter-server-proxy>=4.4.0; extra == 'deploy'
Description-Content-Type: text/markdown

# LDaCA Wordflow Backend

FastAPI service for LDaCA Wordflow. The package can run the API by itself or
serve the bundled production frontend from the same process.

The authoritative source, issue tracker, CI, and package release workflow live
in the [LDaCA Wordflow monorepo](https://github.com/Australian-Text-Analytics-Platform/ldaca-wordflow).

## Quick start

```bash
# Install and run (backend + frontend on one port)
uvx ldaca-wordflow

# Or run only the backend API
uvx ldaca-wordflow --backend

# Custom port
uvx ldaca-wordflow --port 9000
```

## Notebook and BinderHub launch

Use the asynchronous launcher when Python must retain control of the event loop,
such as a BinderHub notebook cell:

```python
import os

from IPython.display import Markdown, display
from ldaca_wordflow import start_async_server

server = await start_async_server(port=8001)
proxy_path = (
    f"{os.environ['JUPYTERHUB_SERVICE_PREFIX'].rstrip('/')}"
    f"/proxy/{server.settings.backend_port}/"
)
display(Markdown(f"[Open Wordflow]({proxy_path})"))
```

`start_async_server()` returns only after ASGI lifespan startup succeeds. Its
caller-owned handle supports waiting and bounded graceful shutdown. Under
JupyterHub, the launcher derives the proxy `root_path` from
`JUPYTERHUB_SERVICE_PREFIX`. Install `ldaca-wordflow[deploy]` in the Binder
environment so `jupyter-server-proxy` is available to the Jupyter server. Do
not run this cell while a CLI-launched instance already owns the same port.

When finished, stop the caller-owned server from another cell:

```python
await server.close()
```

See the [BinderHub runbook](../docs/runbooks/binderhub.md) for image setup,
terminal launch alternatives, proxy behavior, and storage expectations.

## Development

- Backend architecture: [`../docs/architecture/backend/overview.md`](../docs/architecture/backend/overview.md)
- HTTP endpoint inventory: [`../docs/reference/backend-api.md`](../docs/reference/backend-api.md)
- Settings reference: [`../docs/reference/backend-settings.md`](../docs/reference/backend-settings.md)
- Lint: `uv run ruff check .`
- Type check: `uv run ty check`
- Tests: `uv run pytest -q`
- OpenAPI export: `uv run python scripts/export_openapi.py --output <path>`
