Socket
Book a DemoInstallSign in
Socket

streamlit-calendar-input

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamlit-calendar-input

Streamlit component that allows you to display a calendar on which users can select a date.

pipPyPI
Version
0.0.3
Maintainers
1

📅 Streamlit Calendar Input

A custom Streamlit calendar widget that lets users select dates from a list of available options. Dates are shown month-by-month, with green marking available days and red marking unavailable ones.

🔧 Features

  • 📆 Interactive calendar input widget for Streamlit
  • ✅ Green: Available dates
  • ❌ Red: Unavailable dates
  • 🖱️ Click to select a date
  • 🔄 Returns a Python datetime.date object

📦 Installation

pip install streamlit-calendar-input

🚀 Usage

import streamlit as st
from streamlit_calendar_input import calendar_input
import datetime

# Define available dates (e.g. from your backend, bookings, etc.)
available_dates = [
    datetime.date(2025, 6, 20),
    datetime.date(2025, 6, 25),
    datetime.date(2025, 7, 2),
]

# Call the calendar input
selected_date = calendar_input(available_dates)

# Display the selected date
if selected_date:
    st.success(f"You selected: {selected_date}")

🧠 How it Works

  • The widget renders a calendar month by month.

  • Each day is color-coded:

    • ✅ Green: Clickable, available in available_dates
    • ❌ Red: Not clickable, unavailable
  • When a user clicks a green date, the widget returns the corresponding datetime.date object.

📌 Requirements

  • Python 3.7+
  • Streamlit 1.0+

🧪 Development

# Clone the repo
git clone https://github.com/yourusername/streamlit-calendar-input.git
cd streamlit-calendar-input

# (Optional) Create a virtual environment
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows

# Install dependencies
pip install -e .

📝 License

MIT License. See LICENSE for more details.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts