GitHub - fbiney/python-examples: Examples of using Python with RStudio Connect · GitHub
Skip to content

fbiney/python-examples

 
 

Folders and files

Repository files navigation

RStudio Connect & Python

RStudio Connect is a publishing platform for the work your team creates in R and Python. This repository contains examples of Python content you can deploy to Connect, including:

Interactive apps

Web APIs

Documents

Reticulate

Reticulate allows you to call Python from within an R session. This enables you to use models built in Python to power Shiny apps, visualize pandas dataframes with ggplot2, and much more.

Interactive apps

Documents

Getting Started

You can deploy examples from this repo to your Connect server via git-backed deployment, or clone the repository and deploy examples from their manifests with the rsconnect CLI.

If you want to explore an example more closely before deploying it:

  • Clone this repository
  • create a virtual environment in the folder you want to work in
  • restore the needed packages into the virtual environment
$ cd flask-sentiment-analysis-api
$ python -m venv .venv
$ source .venv/bin/activate
$ python -m pip install -U pip setuptools wheel
$ python -m pip install -r requirements.txt

For reticulated content, set the RETICULATE_PYTHON environment variable to point to your virtual environment, by placing an .Renviron file in the folder containing the following:

RETICULATE_PYTHON=.venv/bin/python
  • Run the examples locally
  • Publish the examples with the rsconnect cli
rsconnect deploy api . -n <SERVER-NICKNAME>

About

Examples of using Python with RStudio Connect

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

  • R 52.8%
  • Python 29.8%
  • CSS 10.4%
  • HTML 4.0%
  • Jupyter Notebook 3.0%