gradio-iframe


Namegradio-iframe JSON
Version 0.0.10 PyPI version JSON
download
home_page
SummaryExperimental empowered iFrame component based on existing HTML gradio component.
upload_time2024-01-27 13:32:40
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords html gradio-custom-component gradio-template-html iframe
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gradio_iframe
A custom gradio component to embed an iframe in a gradio interface. This component is based on the [HTML]() component.
It's currently still a work in progress.

## Usage

The usage is similar to the HTML component. You can pass valid html and it will be rendered in the interface as an iframe, meaning you can embed any website or webapp that supports iframes.
Also, JavaScript should run normal. You can even pass an iframe inside an iframe (see below!), i.e. a youtube or spotify embed.

The size will adjust to the size of the iframe (onload), **this is gonna be a bit delayed**. The width is default at 100%. 
You can also set the height and width manually. 

### Example

```python
import gradio as gr
from gradio_iframe import iFrame

gr.Interface(
    iFrame(
        label="iFrame Example",
        value=("""
        <iframe width="560" 
            height="315" 
            src="https://www.youtube.com/embed/dQw4w9WgXcQ?si=QfHLpHZsI98oZT1G" 
            title="YouTube video player" 
            frameborder="0" 
            allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" 
            allowfullscreen>
        </iframe>"""),
        show_label=True)
)
```

## Roadmap

- [ ] Add manual hand over of other iFrame options.
- [ ] Explore switch between src and srcdoc through variable.

## Known Issues

**There are many reason why it's not a good idea to embed websites in an iframe.**
See [this](https://blog.bitsrc.io/4-security-concerns-with-iframes-every-web-developer-should-know-24c73e6a33e4), or just google "iframe security concerns" for more information. Also, iFrames will use additional computing power and memory, which can slow down the interface.

Also, this component is still a work in progress and not fully tested. Use at your own risk.

### Other Issues

- Height sometimes does not grow according to the inner component.
- The component is not completely responsive yet and struggles with variable heigth.
- ...

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gradio-iframe",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "HTML,gradio-custom-component,gradio-template-HTML,iFrame",
    "author": "",
    "author_email": "Lennard Z\u00fcndorf <lennard@zuendorf.me>",
    "download_url": "https://files.pythonhosted.org/packages/46/8e/e0d96706b3e19ce5752d065627cd02d08d15d4c9802d6aa4e638e71aab5b/gradio_iframe-0.0.10.tar.gz",
    "platform": null,
    "description": "# gradio_iframe\nA custom gradio component to embed an iframe in a gradio interface. This component is based on the [HTML]() component.\nIt's currently still a work in progress.\n\n## Usage\n\nThe usage is similar to the HTML component. You can pass valid html and it will be rendered in the interface as an iframe, meaning you can embed any website or webapp that supports iframes.\nAlso, JavaScript should run normal. You can even pass an iframe inside an iframe (see below!), i.e. a youtube or spotify embed.\n\nThe size will adjust to the size of the iframe (onload), **this is gonna be a bit delayed**. The width is default at 100%. \nYou can also set the height and width manually. \n\n### Example\n\n```python\nimport gradio as gr\nfrom gradio_iframe import iFrame\n\ngr.Interface(\n    iFrame(\n        label=\"iFrame Example\",\n        value=(\"\"\"\n        <iframe width=\"560\" \n            height=\"315\" \n            src=\"https://www.youtube.com/embed/dQw4w9WgXcQ?si=QfHLpHZsI98oZT1G\" \n            title=\"YouTube video player\" \n            frameborder=\"0\" \n            allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" \n            allowfullscreen>\n        </iframe>\"\"\"),\n        show_label=True)\n)\n```\n\n## Roadmap\n\n- [ ] Add manual hand over of other iFrame options.\n- [ ] Explore switch between src and srcdoc through variable.\n\n## Known Issues\n\n**There are many reason why it's not a good idea to embed websites in an iframe.**\nSee [this](https://blog.bitsrc.io/4-security-concerns-with-iframes-every-web-developer-should-know-24c73e6a33e4), or just google \"iframe security concerns\" for more information. Also, iFrames will use additional computing power and memory, which can slow down the interface.\n\nAlso, this component is still a work in progress and not fully tested. Use at your own risk.\n\n### Other Issues\n\n- Height sometimes does not grow according to the inner component.\n- The component is not completely responsive yet and struggles with variable heigth.\n- ...\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Experimental empowered iFrame component based on existing HTML gradio component.",
    "version": "0.0.10",
    "project_urls": null,
    "split_keywords": [
        "html",
        "gradio-custom-component",
        "gradio-template-html",
        "iframe"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c6595e0a2df92a8509e0c7a265e34b29197bfc52a6f9dcff40613c72ee1789c",
                "md5": "9d288879143e8fefc22fc7ec99032060",
                "sha256": "91932be427abc4d724d4660bc97cb0f9975112a2b4e891840c5d48b489e9625d"
            },
            "downloads": -1,
            "filename": "gradio_iframe-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9d288879143e8fefc22fc7ec99032060",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 24137,
            "upload_time": "2024-01-27T13:32:38",
            "upload_time_iso_8601": "2024-01-27T13:32:38.256031Z",
            "url": "https://files.pythonhosted.org/packages/4c/65/95e0a2df92a8509e0c7a265e34b29197bfc52a6f9dcff40613c72ee1789c/gradio_iframe-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "468ee0d96706b3e19ce5752d065627cd02d08d15d4c9802d6aa4e638e71aab5b",
                "md5": "66c5728da740273c0537869540b13823",
                "sha256": "ac3ca8d1dbdb6a5dc0c56f4d93262c95eed25c4c7e3b49309c23ba15f9a3f75d"
            },
            "downloads": -1,
            "filename": "gradio_iframe-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "66c5728da740273c0537869540b13823",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 32302,
            "upload_time": "2024-01-27T13:32:40",
            "upload_time_iso_8601": "2024-01-27T13:32:40.176361Z",
            "url": "https://files.pythonhosted.org/packages/46/8e/e0d96706b3e19ce5752d065627cd02d08d15d4c9802d6aa4e638e71aab5b/gradio_iframe-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-27 13:32:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gradio-iframe"
}
        
Elapsed time: 0.17154s