Metadata-Version: 2.1
Name: vetiver
Version: 0.2.2
Summary: Version, share, deploy, and monitor models.
Home-page: https://github.com/rstudio/vetiver-python
Author: Isabel Zimmerman
Author-email: isabel.zimmerman@posit.co
License: MIT
Keywords: data,mlops
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: fastapi
Requires-Dist: pydantic
Requires-Dist: joblib
Requires-Dist: uvicorn
Requires-Dist: scikit-learn
Requires-Dist: nest-asyncio
Requires-Dist: requests
Requires-Dist: pins>=0.7.1
Requires-Dist: rsconnect-python>=1.8.0
Requires-Dist: plotly
Requires-Dist: pip-tools
Requires-Dist: httpx
Requires-Dist: importlib-metadata>=4.4
Provides-Extra: all
Requires-Dist: vetiver[dev]; extra == "all"
Requires-Dist: vetiver[all_models]; extra == "all"
Requires-Dist: vetiver[docs]; extra == "all"
Provides-Extra: all-models
Requires-Dist: vetiver[torch]; extra == "all-models"
Requires-Dist: vetiver[statsmodels]; extra == "all-models"
Requires-Dist: vetiver[xgboost]; extra == "all-models"
Requires-Dist: vetiver[spacy]; extra == "all-models"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-snapshot; extra == "dev"
Requires-Dist: vetiver[typecheck]; extra == "dev"
Provides-Extra: docs
Requires-Dist: quartodoc; extra == "docs"
Requires-Dist: griffe==0.25.1; extra == "docs"
Provides-Extra: statsmodels
Requires-Dist: statsmodels; extra == "statsmodels"
Provides-Extra: torch
Requires-Dist: torch; extra == "torch"
Provides-Extra: xgboost
Requires-Dist: xgboost; extra == "xgboost"
Provides-Extra: spacy
Requires-Dist: spacy; extra == "spacy"
Provides-Extra: typecheck
Requires-Dist: pyright; extra == "typecheck"
Requires-Dist: pandas-stubs; extra == "typecheck"

# vetiver <a href='https://rstudio.github.io/vetiver-python/'><img src='docs/figures/logo.png' align="right" height="138" /></a>

<!-- badges: start -->

[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![codecov](https://codecov.io/gh/isabelizimm/vetiver-python/branch/main/graph/badge.svg?token=CW6JHVS6ZX)](https://codecov.io/gh/isabelizimm/vetiver-python)

<!-- badges: end -->

_Vetiver, the oil of tranquility, is used as a stabilizing ingredient in perfumery to preserve more volatile fragrances._

The goal of vetiver is to provide fluent tooling to version, share, deploy, and monitor a trained model. Functions handle both recording and checking the model's input data prototype, and predicting from a remote API endpoint. The vetiver package is extensible, with generics that can support many kinds of models, and available for both Python and R. To learn more about vetiver, see:

- the documentation at <https://vetiver.rstudio.com/>
- the R package at <https://rstudio.github.io/vetiver-r/>

You can use vetiver with:

-   [scikit-learn](https://scikit-learn.org/)
-   [torch](https://pytorch.org/)
-   [statsmodels](https://www.statsmodels.org/stable/index.html)
-   [xgboost](https://xgboost.readthedocs.io/en/stable/)
-   [spacy](https://spacy.io/)
-   or utilize [custom handlers](https://rstudio.github.io/vetiver-python/stable/advancedusage/custom_handler.html) to support your own models!

## Installation

You can install the released version of vetiver from [PyPI](https://pypi.org/project/vetiver/):

```python
python -m pip install vetiver
```

And the development version from [GitHub](https://github.com/rstudio/vetiver-python) with:

```python
python -m pip install git+https://github.com/rstudio/vetiver-python
```

## Example

A `VetiverModel()` object collects the information needed to store, version, and deploy a trained model.

```python
from vetiver import mock, VetiverModel

X, y = mock.get_mock_data()
model = mock.get_mock_model().fit(X, y)

v = VetiverModel(model, model_name='mock_model', prototype_data=X)
```

You can **version** and **share** your `VetiverModel()` by choosing a [pins](https://rstudio.github.io/pins-python/) "board" for it, including a local folder, [Connect](https://posit.co/products/enterprise/connect/), Amazon S3, and more.

```python
from pins import board_temp
from vetiver import vetiver_pin_write

model_board = board_temp(versioned = True, allow_pickle_read = True)
vetiver_pin_write(model_board, v)
```

You can **deploy** your pinned `VetiverModel()` using `VetiverAPI()`, an extension of [FastAPI](https://fastapi.tiangolo.com/).

```python
from vetiver import VetiverAPI
app = VetiverAPI(v, check_prototype = True)
```

To start a server using this object, use `app.run(port = 8080)` or your port of choice.

## Contributing

This project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.

- For questions and discussions about deploying models, statistical modeling, and machine learning, please [post on Posit Community](https://community.rstudio.com/new-topic?category_id=15&tags=vetiver,question).

- If you think you have encountered a bug, please [submit an issue](https://github.com/rstudio/vetiver-python/issues).
