gradio-foliumtest


Namegradio-foliumtest JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryPython library for easily interacting with trained machine learning models
upload_time2023-10-31 16:42:27
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords gradio gradio custom component gradio-template-fallback machine learning reproducibility visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# gradio_foliumtest

Create a map with folium and display it on the web with Gradio! 

## Example usage

```python
import gradio as gr
from gradio_foliumtest import FoliumTest
from typing import Literal
from folium import Map


LAT_LONG_MAP = {
    "New York City": (40.7128, -74.0060),
    "London": (51.5074, -0.1278),
    "San Francisco": (37.7749, -122.4194),
    "Tokyo": (35.6762, 139.6503),
    "Miami": (25.7617, -80.1918),
}

def get_city(city: Literal["New York City", "London", "San Francisco", "Tokyo", "Miami"]):
    city = city or "Miami"
    return Map(location=LAT_LONG_MAP[city], zoom_start=12)

with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            city = gr.Radio(choices=["New York City", "London", "San Francisco", "Tokyo", "Miami"],
                            label="City")
        with gr.Column():
            map_ = FoliumTest(label="Foo")
        city.change(get_city, city, map_)

demo.launch()
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gradio-foliumtest",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "gradio,gradio custom component,gradio-template-Fallback,machine learning,reproducibility,visualization",
    "author": "",
    "author_email": "YOUR NAME <YOUREMAIL@domain.com>",
    "download_url": "https://files.pythonhosted.org/packages/3b/85/a813a4f65d064c9354b2a7654a4da3ebe6d23caed2f99db4c2f15aa8156f/gradio_foliumtest-0.0.2.tar.gz",
    "platform": null,
    "description": "\n# gradio_foliumtest\n\nCreate a map with folium and display it on the web with Gradio! \n\n## Example usage\n\n```python\nimport gradio as gr\nfrom gradio_foliumtest import FoliumTest\nfrom typing import Literal\nfrom folium import Map\n\n\nLAT_LONG_MAP = {\n    \"New York City\": (40.7128, -74.0060),\n    \"London\": (51.5074, -0.1278),\n    \"San Francisco\": (37.7749, -122.4194),\n    \"Tokyo\": (35.6762, 139.6503),\n    \"Miami\": (25.7617, -80.1918),\n}\n\ndef get_city(city: Literal[\"New York City\", \"London\", \"San Francisco\", \"Tokyo\", \"Miami\"]):\n    city = city or \"Miami\"\n    return Map(location=LAT_LONG_MAP[city], zoom_start=12)\n\nwith gr.Blocks() as demo:\n    with gr.Row():\n        with gr.Column():\n            city = gr.Radio(choices=[\"New York City\", \"London\", \"San Francisco\", \"Tokyo\", \"Miami\"],\n                            label=\"City\")\n        with gr.Column():\n            map_ = FoliumTest(label=\"Foo\")\n        city.change(get_city, city, map_)\n\ndemo.launch()\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python library for easily interacting with trained machine learning models",
    "version": "0.0.2",
    "project_urls": null,
    "split_keywords": [
        "gradio",
        "gradio custom component",
        "gradio-template-fallback",
        "machine learning",
        "reproducibility",
        "visualization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dae029917632627ce5fe33ecd0e2da75f0be04be67eb7d83ffb11aa7855a9add",
                "md5": "53b753483a826e0c02bcd4cd3deaac32",
                "sha256": "5e4e131ec05befb2064310f3b4ec2eab963ef8e5983f1b353f4e46970f7b6405"
            },
            "downloads": -1,
            "filename": "gradio_foliumtest-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "53b753483a826e0c02bcd4cd3deaac32",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 23428,
            "upload_time": "2023-10-31T16:42:26",
            "upload_time_iso_8601": "2023-10-31T16:42:26.314726Z",
            "url": "https://files.pythonhosted.org/packages/da/e0/29917632627ce5fe33ecd0e2da75f0be04be67eb7d83ffb11aa7855a9add/gradio_foliumtest-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b85a813a4f65d064c9354b2a7654a4da3ebe6d23caed2f99db4c2f15aa8156f",
                "md5": "1bfe26b0c6274ede2c76506ef04aba9e",
                "sha256": "220c139a751dac55e65475374d387cd4676d016e2994e0f6351108d77835a725"
            },
            "downloads": -1,
            "filename": "gradio_foliumtest-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1bfe26b0c6274ede2c76506ef04aba9e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 32564,
            "upload_time": "2023-10-31T16:42:27",
            "upload_time_iso_8601": "2023-10-31T16:42:27.727156Z",
            "url": "https://files.pythonhosted.org/packages/3b/85/a813a4f65d064c9354b2a7654a4da3ebe6d23caed2f99db4c2f15aa8156f/gradio_foliumtest-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-31 16:42:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gradio-foliumtest"
}
        
Elapsed time: 0.16356s