Metadata-Version: 2.3
Name: lift-linguistic-features-py
Version: 0.1.1
Summary: Linguistic feature extraction and annotation utilities for text.
Author: PyLift Contributors
Requires-Python: >=3.11,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: dkpro-cassis (>=0.10.1,<0.11.0)
Requires-Dist: lingua-language-detector (>=2.1.1,<3.0.0)
Requires-Dist: pandas (>=2.2.0,<3.0.0)
Requires-Dist: polars (==1.33.1)
Requires-Dist: pyconll (>=3.2.0,<4.0.0)
Requires-Dist: pyspellchecker (>=0.8.1,<0.9.0)
Requires-Dist: rwse-checker (>=0.0.4,<0.0.5)
Requires-Dist: spacy (>=3.8.7,<4.0.0)
Requires-Dist: textstat (>=0.7.3,<0.8.0)
Requires-Dist: udapi (>=0.5.1,<0.6.0)
Requires-Dist: wordfreq (>=3.1.1,<4.0.0)
Description-Content-Type: text/markdown

PyLift is the Python branch of the [LiFT library](https://github.com/zesch/linguistic-features-in-text).

## Installation

Core package:

```bash
pip install py_lift
```

Optional tooling dependencies (examples/workbench):

```bash
poetry install --with examples
```

spaCy language models are optional and must be installed separately when using
`Spacy_Preprocessor` with the default model names:

```bash
python -m py_lift.model_setup --languages en de fr sl tr
```

For Turkish (`tr_core_news_md`) and for `SE_AbstractnessAnnotator`
(`lift-resources-lists`), install the required internal packages from your
organization's package source.

`py_lift.model_setup` supports language-specific wheel URLs via built-in defaults
and overrides. Turkish currently uses this built-in URL by default:

`https://pypi.cats.fernuni-hagen.de/packages/tr_core_news_md-1.0-py3-none-any.whl`

You can override sources for any language via environment variables:

```bash
export PY_LIFT_MODEL_URL_TR="https://your-internal-source/tr_core_news_md-1.0-py3-none-any.whl"
python -m py_lift.model_setup --languages tr
```

Or via CLI:

```bash
python -m py_lift.model_setup --languages tr --model-url tr=https://your-internal-source/tr_core_news_md-1.0-py3-none-any.whl
```

You can also let the preprocessor auto-install missing models at runtime:

```python
from py_lift.preprocessing import Spacy_Preprocessor

prep = Spacy_Preprocessor("en", auto_install_models=True)
```

## Standalone Python example

Run a non-visual end-to-end pipeline example:

```bash
python examples/pure_python_pipeline.py
```

The script is located at `examples/pure_python_pipeline.py` and demonstrates:

- language detection
- spaCy preprocessing
- spelling anomaly annotation
- readability + count feature extraction
- plain stdout output (no visualization)

Other examples (now also in top-level `examples/`):

- `examples/visualization_streamlit.py`
- `examples/visualization_notebook.ipynb`

## Release (PyPI)

Short release checklist:

1. Update the version in `pyproject.toml`.
2. Run tests:

    ```bash
    poetry install --with dev
    poetry run pytest
    ```

Model-dependent tests (for example `py_lift/tests/test_preprocessing.py`) are
marked as `requires_models` and skipped by default. Run them explicitly with:

```bash
poetry run pytest --run-model-tests
```

3. Build distribution artifacts:

    ```bash
    poetry build
    ```

4. Publish:

    ```bash
    export POETRY_PYPI_TOKEN_PYPI="pypi-XXXXXXXXXXXXXXXXXXXX"
    poetry publish
    ```
