Metadata-Version: 2.1
Name: gradio_client
Version: 0.0.1
Summary: Python library for easily interacting with trained machine learning models
Project-URL: Homepage, https://github.com/gradio-app/gradio
Author-email: Abubakar Abid <team@gradio.app>, Ali Abid <team@gradio.app>, Ali Abdalla <team@gradio.app>, Dawood Khan <team@gradio.app>, Ahsen Khaliq <team@gradio.app>, Pete Allen <team@gradio.app>, Freddy Boulton <team@gradio.app>
License-Expression: Apache-2.0
Keywords: API,client,machine learning
Requires-Python: >=3.7
Requires-Dist: fsspec
Requires-Dist: packaging
Requires-Dist: requests
Requires-Dist: websockets
Description-Content-Type: text/markdown

# `gradio_client`: Use any Gradio app as an API -- in 3 lines of Python

This directory contains the source code for `gradio_client`, a lightweight Python library that makes it very easy to use any Gradio app as an API. This library is 

As an example, consider the Stable Diffusion Gradio app, which is hosted on Hugging Face Spaces, and which generates images given a text prompt. Using the `gradio_client` library, we can easily use the Gradio as an API to generates images programmatically.

Here's the entire code to do it:

```python
import gradio_client as grc

client = grc.Client(space="stability-ai/stable-diffusion")
job = client.predict("a hyperrealistic portrait of a cat wearing cyberpunk armor")
job.result()

>> URL

```

## Installation

The lightweit `gradio_client` package can be installed from pip:

```bash
$ pip install gradio_client
```

## Usage

### Connecting to a Space or a Gradio app

1. Connecting to a Space
2. Connecting a general Gradio app

### Inspecting the API

1. Listing all of the available APIs
2. Getting more info about the parameters for a speciic API

### Making a prediction

1. client.run

### Submitting a job (for asynchronous worklows)

1. job = client.submit
2. job.status
3. callbacks


