Metadata-Version: 2.4
Name: grekt-keywords
Version: 0.1.0
Summary: Keyword extraction for grekt artifacts using KeyBERT
Project-URL: Homepage, https://github.com/grekt-labs/keywords
Project-URL: Repository, https://github.com/grekt-labs/keywords
Author: grekt-labs
License-Expression: MIT
License-File: LICENSE
Keywords: artifact,grekt,keybert,keywords,nlp
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: keybert>=0.8.0
Requires-Dist: sentence-transformers>=2.2.0
Description-Content-Type: text/markdown

# grekt-keywords

Keyword extraction for [grekt](https://grekt.com) artifacts using KeyBERT.

## Installation

```bash
# Recommended: CPU-only (~300MB)
pip install grekt-keywords --index-url https://download.pytorch.org/whl/cpu

# With GPU support (~4GB)
pip install grekt-keywords
```

## Usage

### CLI

```bash
# From argument
grekt-keywords "An agent that helps with Kubernetes deployments and Helm charts"

# From stdin
echo "An agent that helps with Kubernetes deployments" | grekt-keywords

# JSON output (for programmatic use)
grekt-keywords --json "Your artifact description here"
```

### Python API

```python
from grekt_keywords import extract_keywords

keywords = extract_keywords("An agent that helps with Kubernetes deployments")
# ['kubernetes', 'deployments', 'agent', 'helps']
```

## Options

| Option | Default | Description |
|--------|---------|-------------|
| `--min` | 3 | Minimum number of keywords |
| `--max` | 5 | Maximum number of keywords |
| `--json` | false | Output as JSON array |

## Why?

grekt artifacts require keywords for discoverability in the lazy-loading index. This tool extracts meaningful keywords from your artifact description using KeyBERT + MiniLM.

## Model

Uses `all-MiniLM-L6-v2` (~80MB) for keyword extraction.

**First run:** Downloads the model from [Hugging Face Hub](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) and caches it in `~/.cache/huggingface/`.

**Subsequent runs:** Uses the cached model (works offline).

For CI/CD environments, the model will be downloaded on first execution. You can pre-cache it by running `grekt-keywords "test"` once.

## License

MIT
