# vetiver <a href='https://rstudio.github.io/vetiver-python/'><img src='docs/figures/logo.png' align="right" height="138" /></a>
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#experimental) [](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).
Raw data
{
"_id": null,
"home_page": "https://github.com/rstudio/vetiver-python",
"name": "vetiver",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "data,mlops",
"author": "Isabel Zimmerman",
"author_email": "isabel.zimmerman@posit.co",
"download_url": "https://files.pythonhosted.org/packages/87/e3/20b25f1a9da73aadceaace79328f45ba5d2dad05b7996555c698f7b1ce34/vetiver-0.2.3.tar.gz",
"platform": null,
"description": "# vetiver <a href='https://rstudio.github.io/vetiver-python/'><img src='docs/figures/logo.png' align=\"right\" height=\"138\" /></a>\n\n<!-- badges: start -->\n\n[](https://lifecycle.r-lib.org/articles/stages.html#experimental) [](https://codecov.io/gh/isabelizimm/vetiver-python)\n\n<!-- badges: end -->\n\n_Vetiver, the oil of tranquility, is used as a stabilizing ingredient in perfumery to preserve more volatile fragrances._\n\nThe 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:\n\n- the documentation at <https://vetiver.rstudio.com/>\n- the R package at <https://rstudio.github.io/vetiver-r/>\n\nYou can use vetiver with:\n\n- [scikit-learn](https://scikit-learn.org/)\n- [torch](https://pytorch.org/)\n- [statsmodels](https://www.statsmodels.org/stable/index.html)\n- [xgboost](https://xgboost.readthedocs.io/en/stable/)\n- [spacy](https://spacy.io/)\n- or utilize [custom handlers](https://rstudio.github.io/vetiver-python/stable/advancedusage/custom_handler.html) to support your own models!\n\n## Installation\n\nYou can install the released version of vetiver from [PyPI](https://pypi.org/project/vetiver/):\n\n```python\npython -m pip install vetiver\n```\n\nAnd the development version from [GitHub](https://github.com/rstudio/vetiver-python) with:\n\n```python\npython -m pip install git+https://github.com/rstudio/vetiver-python\n```\n\n## Example\n\nA `VetiverModel()` object collects the information needed to store, version, and deploy a trained model.\n\n```python\nfrom vetiver import mock, VetiverModel\n\nX, y = mock.get_mock_data()\nmodel = mock.get_mock_model().fit(X, y)\n\nv = VetiverModel(model, model_name='mock_model', prototype_data=X)\n```\n\nYou 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.\n\n```python\nfrom pins import board_temp\nfrom vetiver import vetiver_pin_write\n\nmodel_board = board_temp(versioned = True, allow_pickle_read = True)\nvetiver_pin_write(model_board, v)\n```\n\nYou can **deploy** your pinned `VetiverModel()` using `VetiverAPI()`, an extension of [FastAPI](https://fastapi.tiangolo.com/).\n\n```python\nfrom vetiver import VetiverAPI\napp = VetiverAPI(v, check_prototype = True)\n```\n\nTo start a server using this object, use `app.run(port = 8080)` or your port of choice.\n\n## Contributing\n\nThis 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.\n\n- 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).\n\n- If you think you have encountered a bug, please [submit an issue](https://github.com/rstudio/vetiver-python/issues).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Version, share, deploy, and monitor models.",
"version": "0.2.3",
"project_urls": {
"Homepage": "https://github.com/rstudio/vetiver-python"
},
"split_keywords": [
"data",
"mlops"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "958b30fcaa51e72b683c20e7daab5e7116451349e11669272f94bcf32177e2c6",
"md5": "75dffcc18e5cb28b7eec3d8fa1268700",
"sha256": "51caaa6af4ff8e3a74f1f3d6532b1b0294ad2a07854aaf918a7ac76e3b559aa4"
},
"downloads": -1,
"filename": "vetiver-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "75dffcc18e5cb28b7eec3d8fa1268700",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 109573,
"upload_time": "2023-09-14T03:03:24",
"upload_time_iso_8601": "2023-09-14T03:03:24.383902Z",
"url": "https://files.pythonhosted.org/packages/95/8b/30fcaa51e72b683c20e7daab5e7116451349e11669272f94bcf32177e2c6/vetiver-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "87e320b25f1a9da73aadceaace79328f45ba5d2dad05b7996555c698f7b1ce34",
"md5": "7bf0d8cf2e8352638a461e6be5012c48",
"sha256": "6337f32662798e2436f2b4660f0ff6cf3b8d6efd2f29d3e397137e0d0cb653b1"
},
"downloads": -1,
"filename": "vetiver-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "7bf0d8cf2e8352638a461e6be5012c48",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 288083,
"upload_time": "2023-09-14T03:03:26",
"upload_time_iso_8601": "2023-09-14T03:03:26.605684Z",
"url": "https://files.pythonhosted.org/packages/87/e3/20b25f1a9da73aadceaace79328f45ba5d2dad05b7996555c698f7b1ce34/vetiver-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-14 03:03:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rstudio",
"github_project": "vetiver-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "vetiver"
}