colab_host package¶
Submodules¶
colab_host.colab_host module¶
-
class
colab_host.colab_host.
FlaskApp
(port: int = 1000, app='main:app', git_url='https://github.com/PuneethaPai/colab_host_flask_demo', requirements_file: str = 'requirements.txt')[source]¶ Bases:
colab_host.colab_host.Host
Class to expose python Flask or Gunicorn application.
Parameters:
port : int, optional
- app : str, optional
- Definition of your python gunicorn app. (Defaults to “main:app”).
- git_url : str, optional
- Git URL to clone your repo containing application. (Defaults to “https://github.com/PuneethaPai/colab_host_flask_demo”).
- requirements_file: str, optional
- Name of file in repo git_url containing requirements for hosting the application. (Defaults to “requirements.txt”).
-
class
colab_host.colab_host.
Host
(port: int = 1000, requirements: list = None, git_url: str = None)[source]¶ Bases:
object
Base class for hosting any python application.
Given port number it will expose the port to internet. Given requirements will install them using pip install. Given git_url it will clone the repo for you.
Parameters:
port : int, optional
- requirements : List[str] or str, optional
- List[str]: list of package requirements for hosting. str: requirements file path to install requirements from.
git_url : str, optional
-
class
colab_host.colab_host.
JupyterLab
(port: int = 1000, requirements: list = ['jupyterlab'])[source]¶ Bases:
colab_host.colab_host.Host
Class to expose Jupyter Lab IDE on browser.
Parameters:
port : int, optional
- requirements : List[str], optional
- Defaults to [“jupyterlab”] and you can include other packages to include with this. For example notebook extension, theme, etc
-
class
colab_host.colab_host.
JupyterNotebook
(port: int = 1000, requirements: list = ['notebook'])[source]¶ Bases:
colab_host.colab_host.Host
Class to expose Jupyter Notebook IDE on browser.
Parameters:
port : int, optional
- requirements : List[str], optional
- Defaults to [“notebook”] and you can include other packages to include with this. For example notebook extension, theme, etc
-
class
colab_host.colab_host.
SimpleHttpServer
(port: int = 1000)[source]¶ Bases:
colab_host.colab_host.Host
Class to expose simple file server application.
Parameters:
port : int, optional
-
class
colab_host.colab_host.
UvicornApp
(port: int = 1000, app='main:app', git_url='https://github.com/PuneethaPai/colab_host_flask_demo', requirements_file: str = 'requirements.txt')[source]¶ Bases:
colab_host.colab_host.Host
Class to expose python FastApi or Uvicorn application.
Parameters:
port : int, optional
- app : str, optional
- Definition of your python gunicorn app. (Defaults to “main:app”).
- git_url : str, optional
- Git URL to clone your repo containing application. (Defaults to “https://github.com/PuneethaPai/colab_host_uvicorn_demo”).
- requirements_file: str, optional
- Name of file in repo git_url containing requirements for hosting the application. (Defaults to “requirements.txt”).
Module contents¶
Top-level package for ColabHost.