Skip to main content

Gradio component for selecting dates with a calendar 📆

Project description

gradio_calendar 📅

A calendar component that lets users pick dates!

Preprocessing: The date passed to the python function will be a string formatted as YYYY-MM-DD or a datetime.datetime object depending on the value of the type parameter.

Postprocessing: The value returned from the function can be a string or a datetime.datetime object.

Example usage

import gradio as gr
from gradio_calendar import Calendar
import datetime

def is_weekday(date: datetime.datetime):
    return date.weekday() < 5

demo = gr.Interface(is_weekday, 
    [Calendar(type="datetime", label="Select a date")], 
    gr.Label(label="Is it a weekend?"))


demo.launch()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradio_calendar-0.0.2.tar.gz (23.4 kB view hashes)

Uploaded Source

Built Distribution

gradio_calendar-0.0.2-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page