Metadata-Version: 2.4
Name: biblioflow-nb
Version: 0.3.0
Summary: Notebook widget application for biblioflow bibliometric workflows.
License-Expression: BSD-3-Clause
Keywords: bibliometrics,biblioflow,jupyter,ipywidgets,google-colab,notebook
Author: Ivan Ogasawara
Author-email: ivan.ogasawara@gmail.com
Requires-Python: >=3.10,<4
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Provides-Extra: dev
Provides-Extra: notebooks
Provides-Extra: plot
Requires-Dist: IPython (>=8)
Requires-Dist: biblioflow (>=0.3.0)
Requires-Dist: ipywidgets (>=8)
Requires-Dist: mypy (>=1.10) ; extra == "dev"
Requires-Dist: nbclient (>=0.10) ; extra == "notebooks"
Requires-Dist: plotly (>=5) ; extra == "plot"
Requires-Dist: prisma-flow (>=0.5.0)
Requires-Dist: pytest (>=8) ; extra == "dev"
Requires-Dist: pytest-cov (>=5) ; extra == "dev"
Requires-Dist: ruff (>=0.6) ; extra == "dev"
Project-URL: Documentation, https://osl-incubator.github.io/biblioflow/
Project-URL: Homepage, https://github.com/osl-incubator/biblioflow
Project-URL: Issues, https://github.com/osl-incubator/biblioflow/issues
Project-URL: Repository, https://github.com/osl-incubator/biblioflow
Description-Content-Type: text/markdown

# biblioflow-nb

Notebook widget application for `biblioflow` bibliometric workflows.

`biblioflow-nb` provides a Jupyter/Colab-friendly widget UI that mirrors the
core workflow of `biblioflow-web` without running FastAPI, React, or a local web
server. All calculations are delegated to the core `biblioflow` package.

## Quickstart

```python
import biblioflow_nb as bfn

bfn.colab_setup()  # safe outside Google Colab
app = bfn.launch()
```

Launch with an existing dataset:

```python
import biblioflow as bf
import biblioflow_nb as bfn

dataset = bf.load("records.ris")
app = bfn.launch(records=dataset)
```

Import from PubMed/PMC directly, or stage records first for screening:

```python
import os
import biblioflow_nb as bfn

os.environ["BIBLIOFLOW_NCBI_EMAIL"] = "researcher@example.org"

app = bfn.app(display=False)
app.from_pubmed(query="bibliometrics AND reproducibility", limit=20)
app.from_pmc(query="open science", limit=20)

run = app.stage_pubmed(query="bibliometrics AND reproducibility", limit=20)
app.update_candidates([run["candidates"][0]["candidate_id"]], status="selected")
app.promote_candidates()
app.display()
```

The widget app also includes a **Remote screening** panel. API keys can be
provided in the panel or through `BIBLIOFLOW_NCBI_API_KEY`; they are not stored
in the session manifest.

Generic screening helpers are available for any records or local file:

```python
app.stage_records([{"title": "Manual candidate"}], source="generic")
app.stage_file("records.ris", source="auto", format="auto")
app.stage_pmc(query="open science", limit=50)
app.update_candidates(["candidate-id"], status="maybe")
app.promote_candidates(include_statuses=("selected", "maybe"))
```

## Development

```bash
cd packages/biblioflow-nb
PYTHONPATH=src:../biblioflow/src pytest --cov=biblioflow_nb --cov-fail-under=90
PYTHONPATH=src:../biblioflow/src python -m ruff check src tests
PYTHONPATH=src:../biblioflow/src python -m mypy src
poetry build
```

