# Gradio-FastAPI: Publicly Share and Demo Your FastAPI Apps Through Gradio Tunneling
This repository provides a simple and efficient way to tunnel any FastAPI application through a public Gradio URL. By leveraging this tool, developers can quickly demo and share their FastAPI applications with others without the need for complex server configurations or deployment processes. Ideal for quick prototyping, testing, and collaborative development, this solution ensures your FastAPI app is accessible from anywhere with minimal setup.
## Features
- **Seamless Integration**: Easily connect your FastAPI app to a public Gradio URL.
- **Quick Setup**: Get your FastAPI app running publicly in just a few steps.
- **Convenient Sharing**: Share your app with collaborators via a simple URL.
- **Efficient Prototyping**: Perfect for quick demos, testing, and feedback collection.
## Installation
```bash
pip install fastapi-gradio
```
## Usage
1. Import the tunnel lifespan function initializer in your FastAPI app:
```python
from gradio_fastapi import gradio_lifespan_init
```
2. Set the lifespan of the App:
1. If you do not already have a lifespan function defined:
```python
app = FastAPI(lifespan=gradio_lifespan_init())
```
2. If you do
```python
app = FastAPI(lifespan=gradio_lifespan_init(my_lifespan))
```
3. Run your app and get the public Gradio URL for sharing logged using uvicorn:
```bash
fastapi dev main.py
```
## Example
Check out example.py for a sample FastAPI application using this tunnel.
## Contributions
Feel free to open issues or submit pull requests. Contributions are welcome!
## License
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": "https://github.com/HishamYahya/gradio-fastapi",
"name": "gradio-fastapi",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Gradio, Deployment, FastAPI, Server, Demoing, Backend, Frontend, Serving",
"author": "Hisham Alyahya",
"author_email": "Hishamaalyahya@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8f/ed/7c4ce6f5574e5924f7cb62943c1c2bd99de4f2197eba024148a7bfbeb836/gradio_fastapi-0.1.0.tar.gz",
"platform": null,
"description": "# Gradio-FastAPI: Publicly Share and Demo Your FastAPI Apps Through Gradio Tunneling\n\nThis repository provides a simple and efficient way to tunnel any FastAPI application through a public Gradio URL. By leveraging this tool, developers can quickly demo and share their FastAPI applications with others without the need for complex server configurations or deployment processes. Ideal for quick prototyping, testing, and collaborative development, this solution ensures your FastAPI app is accessible from anywhere with minimal setup.\n\n## Features\n- **Seamless Integration**: Easily connect your FastAPI app to a public Gradio URL.\n- **Quick Setup**: Get your FastAPI app running publicly in just a few steps.\n- **Convenient Sharing**: Share your app with collaborators via a simple URL.\n- **Efficient Prototyping**: Perfect for quick demos, testing, and feedback collection.\n\n## Installation\n```bash\npip install fastapi-gradio\n```\n\n## Usage\n1. Import the tunnel lifespan function initializer in your FastAPI app:\n ```python\n from gradio_fastapi import gradio_lifespan_init\n ```\n\n2. Set the lifespan of the App:\n 1. If you do not already have a lifespan function defined: \n ```python \n app = FastAPI(lifespan=gradio_lifespan_init())\n ```\n 2. If you do\n ```python\n app = FastAPI(lifespan=gradio_lifespan_init(my_lifespan))\n ```\n\n3. Run your app and get the public Gradio URL for sharing logged using uvicorn:\n ```bash\n fastapi dev main.py\n ```\n\n## Example\nCheck out example.py for a sample FastAPI application using this tunnel.\n\n## Contributions\nFeel free to open issues or submit pull requests. Contributions are welcome!\n\n## License\nThis project is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Easily Share and Demo Your FastAPI Apps using Gradio Public URL Tunneling",
"version": "0.1.0",
"project_urls": {
"Download": "https://github.com/HishamYahya/gradio-fastapi/archive/refs/tags/v0.1.0.tar.gz",
"Homepage": "https://github.com/HishamYahya/gradio-fastapi"
},
"split_keywords": [
"gradio",
" deployment",
" fastapi",
" server",
" demoing",
" backend",
" frontend",
" serving"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8fed7c4ce6f5574e5924f7cb62943c1c2bd99de4f2197eba024148a7bfbeb836",
"md5": "27066527e793f42c9f1a2938c257e01f",
"sha256": "31774426d4753658ba6d8c06608830e25d99a458185751de47519e58daa24df2"
},
"downloads": -1,
"filename": "gradio_fastapi-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "27066527e793f42c9f1a2938c257e01f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5413,
"upload_time": "2024-06-25T19:33:20",
"upload_time_iso_8601": "2024-06-25T19:33:20.107081Z",
"url": "https://files.pythonhosted.org/packages/8f/ed/7c4ce6f5574e5924f7cb62943c1c2bd99de4f2197eba024148a7bfbeb836/gradio_fastapi-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-25 19:33:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HishamYahya",
"github_project": "gradio-fastapi",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "gradio-fastapi"
}