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)
Built Distribution
Close
Hashes for gradio_calendar-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bd6039e7cd368d36ae1a4814bf9f18837b78e9b9f09b8b553d64c9f9fa861ca |
|
MD5 | 3c76423569beae84951c862caa6b0788 |
|
BLAKE2b-256 | 9fc2874a5a97e027106ef1f4a1062b925caf19fdf2af5739720d17fd9cc893bb |