gradio-log


Namegradio-log JSON
Version 0.0.8 PyPI version JSON
download
home_pageNone
SummaryA Log component for Gradio which can easily show some log file in the interface.
upload_time2024-12-05 15:00:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords gradio-custom-component gradio-template-simpletextbox gradio_log gradio_log_component gradio_print_log log
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# `gradio_log`
<a href="https://pypi.org/project/gradio_log/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_log"></a>  

A Log component for Gradio which can easily show some log file in the interface.

## Installation

```bash
pip install gradio_log
```

## Usage

```python
import logging
from pathlib import Path

import gradio as gr
from gradio_log import Log


class CustomFormatter(logging.Formatter):

    green = "\x1b[32;20m"
    blue = "\x1b[34;20m"
    yellow = "\x1b[33;20m"
    red = "\x1b[31;20m"
    bold_red = "\x1b[31;1m"
    reset = "\x1b[0m"
    format = "%(asctime)s - %(levelname)s - %(message)s (%(filename)s:%(lineno)d)"

    FORMATS = {
        logging.DEBUG: blue + format + reset,
        logging.INFO: green + format + reset,
        logging.WARNING: yellow + format + reset,
        logging.ERROR: red + format + reset,
        logging.CRITICAL: bold_red + format + reset,
    }

    def format(self, record):
        log_fmt = self.FORMATS.get(record.levelno)
        formatter = logging.Formatter(log_fmt)
        return formatter.format(record)


formatter = CustomFormatter()

log_file = "/tmp/gradio_log.txt"
Path(log_file).touch()

ch = logging.FileHandler(log_file)
ch.setLevel(logging.DEBUG)
ch.setFormatter(formatter)

logger = logging.getLogger("gradio_log")
logger.setLevel(logging.DEBUG)
for handler in logger.handlers:
    logger.removeHandler(handler)
logger.addHandler(ch)


logger.info("The logs will be displayed in here.")


def create_log_handler(level):
    def l(text):
        getattr(logger, level)(text)

    return l


with gr.Blocks() as demo:
    text = gr.Textbox(label="Enter text to write to log file")
    with gr.Row():
        for l in ["debug", "info", "warning", "error", "critical"]:
            button = gr.Button(f"log as {l}")
            button.click(fn=create_log_handler(l), inputs=text)
    Log(log_file, dark=True)


if __name__ == "__main__":
    demo.launch(ssr_mode=True)

```

## `Log`

### Initialization

<table>
<thead>
<tr>
<th align="left">name</th>
<th align="left" style="width: 25%;">type</th>
<th align="left">default</th>
<th align="left">description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>log_file</code></td>
<td align="left" style="width: 25%;">

```python
str
```

</td>
<td align="left"><code>None</code></td>
<td align="left">the log file path to read from.</td>
</tr>

<tr>
<td align="left"><code>tail</code></td>
<td align="left" style="width: 25%;">

```python
int
```

</td>
<td align="left"><code>100</code></td>
<td align="left">from the end of the file, the number of lines to start read from.</td>
</tr>

<tr>
<td align="left"><code>dark</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>False</code></td>
<td align="left">if True, will render the component in dark mode.</td>
</tr>

<tr>
<td align="left"><code>height</code></td>
<td align="left" style="width: 25%;">

```python
str | int | None
```

</td>
<td align="left"><code>240</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_allow_proposed_api</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_allow_transparency</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_alt_click_moves_cursor</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>True</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_convert_eol</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_cursor_blink</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_cursor_inactive_style</code></td>
<td align="left" style="width: 25%;">

```python
"outline" | "block" | "bar" | "underline" | "none"
```

</td>
<td align="left"><code>"outline"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_cursor_style</code></td>
<td align="left" style="width: 25%;">

```python
"block" | "underline" | "bar"
```

</td>
<td align="left"><code>"block"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_cursor_width</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>1</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_custom_glyphs</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_disable_stdin</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>True</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_document_override</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[typing.Any][typing.Any, None]
```

</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_draw_bold_text_in_bright_colors</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>True</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_fast_scroll_modifier</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[
    typing.Literal["none", "alt", "ctrl", "shift"]
]["none" | "alt" | "ctrl" | "shift", None]
```

</td>
<td align="left"><code>"alt"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_fast_scroll_sensitivity</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>1</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_font_family</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[str][str, None]
```

</td>
<td align="left"><code>"courier-new, courier, monospace"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_font_size</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>15</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_font_weight</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[
    typing.Literal[
        "normal",
        "bold",
        "100",
        "200",
        "300",
        "400",
        "500",
        "600",
        "700",
        "800",
        "900",
    ]
][
    "normal"
    | "bold"
    | "100"
    | "200"
    | "300"
    | "400"
    | "500"
    | "600"
    | "700"
    | "800"
    | "900",
    None,
]
```

</td>
<td align="left"><code>"normal"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_font_weight_bold</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[
    typing.Literal[
        "normal",
        "bold",
        "100",
        "200",
        "300",
        "400",
        "500",
        "600",
        "700",
        "800",
        "900",
    ]
][
    "normal"
    | "bold"
    | "100"
    | "200"
    | "300"
    | "400"
    | "500"
    | "600"
    | "700"
    | "800"
    | "900",
    None,
]
```

</td>
<td align="left"><code>"bold"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_ignore_bracketed_paste_mode</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_letter_spacing</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[float][float, None]
```

</td>
<td align="left"><code>0</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_line_height</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[float][float, None]
```

</td>
<td align="left"><code>1.0</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_log_level</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[
    typing.Literal[
        "trace", "debug", "info", "warn", "error", "off"
    ]
][
    "trace" | "debug" | "info" | "warn" | "error" | "off",
    None,
]
```

</td>
<td align="left"><code>"info"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_mac_option_click_forces_selection</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_mac_option_is_meta</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_minimum_contrast_ratio</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>1</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_overview_ruler_width</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>0</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_rescale_overlapping_glyphs</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_screen_reader_mode</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_scroll_on_user_input</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>True</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_scroll_sensitivity</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>1</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_scrollback</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>1000</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_smooth_scroll_duration</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>0</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_tab_stop_width</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[int][int, None]
```

</td>
<td align="left"><code>8</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>xterm_windows_mode</code></td>
<td align="left" style="width: 25%;">

```python
typing.Optional[bool][bool, None]
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>label</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.</td>
</tr>

<tr>
<td align="left"><code>info</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">additional component description.</td>
</tr>

<tr>
<td align="left"><code>every</code></td>
<td align="left" style="width: 25%;">

```python
float
```

</td>
<td align="left"><code>0.5</code></td>
<td align="left">New log pulling interval.</td>
</tr>

<tr>
<td align="left"><code>show_label</code></td>
<td align="left" style="width: 25%;">

```python
bool | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">if True, will display label.</td>
</tr>

<tr>
<td align="left"><code>container</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If True, will place the component in a container - providing some extra padding around the border.</td>
</tr>

<tr>
<td align="left"><code>scale</code></td>
<td align="left" style="width: 25%;">

```python
int | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>
</tr>

<tr>
<td align="left"><code>min_width</code></td>
<td align="left" style="width: 25%;">

```python
int
```

</td>
<td align="left"><code>160</code></td>
<td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
</tr>

<tr>
<td align="left"><code>interactive</code></td>
<td align="left" style="width: 25%;">

```python
bool | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.</td>
</tr>

<tr>
<td align="left"><code>visible</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If False, component will be hidden.</td>
</tr>

<tr>
<td align="left"><code>elem_id</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
</tr>

<tr>
<td align="left"><code>elem_classes</code></td>
<td align="left" style="width: 25%;">

```python
list[str] | str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
</tr>

<tr>
<td align="left"><code>render</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
</tr>
</tbody></table>


### Events

| name | description |
|:-----|:------------|
| `load` | This listener is triggered when the Log initially loads in the browser. |



### User function

The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).

- When used as an Input, the component only impacts the input signature of the user function.
- When used as an output, the component only impacts the return signature of the user function.

The code snippet below is accurate in cases where the component is used as both an input and an output.

- **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.


 ```python
 def predict(
     value: typing.Any
 ) -> Unknown:
     return value
 ```
 

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gradio-log",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "gradio-custom-component, gradio-template-SimpleTextbox, gradio_log, gradio_log_component, gradio_print_log, log",
    "author": null,
    "author_email": "Chenglu <chenglu.she@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/6a/8d/368e16b93fdd2fc0b601ff648a7786e8551a7b4cc946faec0bdcff33ea4e/gradio_log-0.0.8.tar.gz",
    "platform": null,
    "description": "\n# `gradio_log`\n<a href=\"https://pypi.org/project/gradio_log/\" target=\"_blank\"><img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/gradio_log\"></a>  \n\nA Log component for Gradio which can easily show some log file in the interface.\n\n## Installation\n\n```bash\npip install gradio_log\n```\n\n## Usage\n\n```python\nimport logging\nfrom pathlib import Path\n\nimport gradio as gr\nfrom gradio_log import Log\n\n\nclass CustomFormatter(logging.Formatter):\n\n    green = \"\\x1b[32;20m\"\n    blue = \"\\x1b[34;20m\"\n    yellow = \"\\x1b[33;20m\"\n    red = \"\\x1b[31;20m\"\n    bold_red = \"\\x1b[31;1m\"\n    reset = \"\\x1b[0m\"\n    format = \"%(asctime)s - %(levelname)s - %(message)s (%(filename)s:%(lineno)d)\"\n\n    FORMATS = {\n        logging.DEBUG: blue + format + reset,\n        logging.INFO: green + format + reset,\n        logging.WARNING: yellow + format + reset,\n        logging.ERROR: red + format + reset,\n        logging.CRITICAL: bold_red + format + reset,\n    }\n\n    def format(self, record):\n        log_fmt = self.FORMATS.get(record.levelno)\n        formatter = logging.Formatter(log_fmt)\n        return formatter.format(record)\n\n\nformatter = CustomFormatter()\n\nlog_file = \"/tmp/gradio_log.txt\"\nPath(log_file).touch()\n\nch = logging.FileHandler(log_file)\nch.setLevel(logging.DEBUG)\nch.setFormatter(formatter)\n\nlogger = logging.getLogger(\"gradio_log\")\nlogger.setLevel(logging.DEBUG)\nfor handler in logger.handlers:\n    logger.removeHandler(handler)\nlogger.addHandler(ch)\n\n\nlogger.info(\"The logs will be displayed in here.\")\n\n\ndef create_log_handler(level):\n    def l(text):\n        getattr(logger, level)(text)\n\n    return l\n\n\nwith gr.Blocks() as demo:\n    text = gr.Textbox(label=\"Enter text to write to log file\")\n    with gr.Row():\n        for l in [\"debug\", \"info\", \"warning\", \"error\", \"critical\"]:\n            button = gr.Button(f\"log as {l}\")\n            button.click(fn=create_log_handler(l), inputs=text)\n    Log(log_file, dark=True)\n\n\nif __name__ == \"__main__\":\n    demo.launch(ssr_mode=True)\n\n```\n\n## `Log`\n\n### Initialization\n\n<table>\n<thead>\n<tr>\n<th align=\"left\">name</th>\n<th align=\"left\" style=\"width: 25%;\">type</th>\n<th align=\"left\">default</th>\n<th align=\"left\">description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>log_file</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">the log file path to read from.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>tail</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint\n```\n\n</td>\n<td align=\"left\"><code>100</code></td>\n<td align=\"left\">from the end of the file, the number of lines to start read from.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>dark</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">if True, will render the component in dark mode.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>height</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | int | None\n```\n\n</td>\n<td align=\"left\"><code>240</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_allow_proposed_api</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_allow_transparency</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_alt_click_moves_cursor</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_convert_eol</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_cursor_blink</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_cursor_inactive_style</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\n\"outline\" | \"block\" | \"bar\" | \"underline\" | \"none\"\n```\n\n</td>\n<td align=\"left\"><code>\"outline\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_cursor_style</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\n\"block\" | \"underline\" | \"bar\"\n```\n\n</td>\n<td align=\"left\"><code>\"block\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_cursor_width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>1</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_custom_glyphs</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_disable_stdin</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_document_override</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[typing.Any][typing.Any, None]\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_draw_bold_text_in_bright_colors</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_fast_scroll_modifier</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[\n    typing.Literal[\"none\", \"alt\", \"ctrl\", \"shift\"]\n][\"none\" | \"alt\" | \"ctrl\" | \"shift\", None]\n```\n\n</td>\n<td align=\"left\"><code>\"alt\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_fast_scroll_sensitivity</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>1</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_font_family</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[str][str, None]\n```\n\n</td>\n<td align=\"left\"><code>\"courier-new, courier, monospace\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_font_size</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>15</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_font_weight</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[\n    typing.Literal[\n        \"normal\",\n        \"bold\",\n        \"100\",\n        \"200\",\n        \"300\",\n        \"400\",\n        \"500\",\n        \"600\",\n        \"700\",\n        \"800\",\n        \"900\",\n    ]\n][\n    \"normal\"\n    | \"bold\"\n    | \"100\"\n    | \"200\"\n    | \"300\"\n    | \"400\"\n    | \"500\"\n    | \"600\"\n    | \"700\"\n    | \"800\"\n    | \"900\",\n    None,\n]\n```\n\n</td>\n<td align=\"left\"><code>\"normal\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_font_weight_bold</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[\n    typing.Literal[\n        \"normal\",\n        \"bold\",\n        \"100\",\n        \"200\",\n        \"300\",\n        \"400\",\n        \"500\",\n        \"600\",\n        \"700\",\n        \"800\",\n        \"900\",\n    ]\n][\n    \"normal\"\n    | \"bold\"\n    | \"100\"\n    | \"200\"\n    | \"300\"\n    | \"400\"\n    | \"500\"\n    | \"600\"\n    | \"700\"\n    | \"800\"\n    | \"900\",\n    None,\n]\n```\n\n</td>\n<td align=\"left\"><code>\"bold\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_ignore_bracketed_paste_mode</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_letter_spacing</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[float][float, None]\n```\n\n</td>\n<td align=\"left\"><code>0</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_line_height</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[float][float, None]\n```\n\n</td>\n<td align=\"left\"><code>1.0</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_log_level</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[\n    typing.Literal[\n        \"trace\", \"debug\", \"info\", \"warn\", \"error\", \"off\"\n    ]\n][\n    \"trace\" | \"debug\" | \"info\" | \"warn\" | \"error\" | \"off\",\n    None,\n]\n```\n\n</td>\n<td align=\"left\"><code>\"info\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_mac_option_click_forces_selection</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_mac_option_is_meta</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_minimum_contrast_ratio</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>1</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_overview_ruler_width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>0</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_rescale_overlapping_glyphs</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_screen_reader_mode</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_scroll_on_user_input</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_scroll_sensitivity</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>1</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_scrollback</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>1000</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_smooth_scroll_duration</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>0</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_tab_stop_width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[int][int, None]\n```\n\n</td>\n<td align=\"left\"><code>8</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>xterm_windows_mode</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntyping.Optional[bool][bool, None]\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>info</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">additional component description.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>every</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nfloat\n```\n\n</td>\n<td align=\"left\"><code>0.5</code></td>\n<td align=\"left\">New log pulling interval.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>show_label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">if True, will display label.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>container</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If True, will place the component in a container - providing some extra padding around the border.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>scale</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>min_width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint\n```\n\n</td>\n<td align=\"left\"><code>160</code></td>\n<td align=\"left\">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>interactive</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>visible</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If False, component will be hidden.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_id</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_classes</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nlist[str] | str | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>render</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>\n</tr>\n</tbody></table>\n\n\n### Events\n\n| name | description |\n|:-----|:------------|\n| `load` | This listener is triggered when the Log initially loads in the browser. |\n\n\n\n### User function\n\nThe impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).\n\n- When used as an Input, the component only impacts the input signature of the user function.\n- When used as an output, the component only impacts the return signature of the user function.\n\nThe code snippet below is accurate in cases where the component is used as both an input and an output.\n\n- **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.\n\n\n ```python\n def predict(\n     value: typing.Any\n ) -> Unknown:\n     return value\n ```\n \n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A Log component for Gradio which can easily show some log file in the interface.",
    "version": "0.0.8",
    "project_urls": {
        "Homepage": "https://github.com/louis-she/gradio-log",
        "Repository": "https://github.com/louis-she/gradio-log"
    },
    "split_keywords": [
        "gradio-custom-component",
        " gradio-template-simpletextbox",
        " gradio_log",
        " gradio_log_component",
        " gradio_print_log",
        " log"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d9b5caba8a73175d2c6d8ebd72d92d1e6943f188cb5fff2196593a5f0d0dc1e",
                "md5": "3b5862a9134aa45d451c02a55591920b",
                "sha256": "ed88db174429cc539c3bd9605891471f69544aafb930c36706a67a073459db48"
            },
            "downloads": -1,
            "filename": "gradio_log-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3b5862a9134aa45d451c02a55591920b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1220834,
            "upload_time": "2024-12-05T15:00:46",
            "upload_time_iso_8601": "2024-12-05T15:00:46.994044Z",
            "url": "https://files.pythonhosted.org/packages/4d/9b/5caba8a73175d2c6d8ebd72d92d1e6943f188cb5fff2196593a5f0d0dc1e/gradio_log-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a8d368e16b93fdd2fc0b601ff648a7786e8551a7b4cc946faec0bdcff33ea4e",
                "md5": "f2ab577f9205380a82bc401b1cf0d69c",
                "sha256": "43d7aeb2651fb3b0583f6c205bdabc4ede50b47b531328174db9b0ca63cccf0c"
            },
            "downloads": -1,
            "filename": "gradio_log-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "f2ab577f9205380a82bc401b1cf0d69c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3457531,
            "upload_time": "2024-12-05T15:00:49",
            "upload_time_iso_8601": "2024-12-05T15:00:49.673683Z",
            "url": "https://files.pythonhosted.org/packages/6a/8d/368e16b93fdd2fc0b601ff648a7786e8551a7b4cc946faec0bdcff33ea4e/gradio_log-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-05 15:00:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "louis-she",
    "github_project": "gradio-log",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gradio-log"
}
        
Elapsed time: 1.37212s