Metadata-Version: 2.4
Name: kube-classify
Version: 0.1.0
Summary: Python package for classifying kubectl commands as modifying or non-modifying
Home-page: https://github.com/zvdy/kube-classify
Author: zvdy
Author-email: zvdy <zzvdyy@gmail.com>
Project-URL: Homepage, https://github.com/zvdy/kube-classify
Project-URL: Repository, https://github.com/zvdy/kube-classify
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scikit-learn>=1.0
Requires-Dist: joblib>=1.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Kubectl Infra Classifier

Classifies if a kubectl command modifies infrastructure (yes/no).

## Features
- Detects if a kubectl command is modifying ("yes") or non-modifying ("no")
- Handles real-world, piped, and complex kubectl command scenarios
- Designed for extensibility and production use

## Installation

```sh
pip install .
# or with build isolation
pip install --use-pep517 .
```

## Usage

### As a Python package
```python
from kube_classify.utils import load_model
model = load_model("models/kubectl_classifier.joblib")
result = model.predict(["kubectl apply -f deployment.yaml"])
print("yes" if result[0] == 1 else "no")
```

### Training
Train a new model with your dataset:
```sh
make train
```

## Makefile Commands
- `make install` — Install the package in editable mode for development
- `make train` — Train the model (ensures correct PYTHONPATH)
- `make test` — Run the test suite
- `make lint` — Lint the codebase with flake8
- `make clean` — Remove model artifacts and cache files

## Project Structure
- `src/kube_classify/` — Main package code
- `data/` — Training data
- `models/` — Saved models
- `tests/` — Test suite

## License
MIT
