Skip to main content

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

Project description

📅 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


🧪 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.

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

streamlit_calendar_input-0.0.3.tar.gz (126.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_calendar_input-0.0.3-py3-none-any.whl (125.9 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_calendar_input-0.0.3.tar.gz.

File metadata

  • Download URL: streamlit_calendar_input-0.0.3.tar.gz
  • Upload date:
  • Size: 126.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for streamlit_calendar_input-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5cccaaaac1b515a086d406c7943814ac9557553e6ae78a4fc588a2f8a722f8fd
MD5 d7b2ddbba7f3b2a83aa41a749c99dff4
BLAKE2b-256 b63b1a78a113a682a8f195b8fda16efaf2951031f785bc982105596b69fc5585

See more details on using hashes here.

File details

Details for the file streamlit_calendar_input-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_calendar_input-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 daf70cc3aff9b28fead77921b833c912c3f91e180656315ba9de78eb443eee95
MD5 f1b57226a24a62325c03a720df296a68
BLAKE2b-256 02a3d7e89b4e626ad446d792d738337449b52604e77e022d47e73d65a7c0d1aa

See more details on using hashes here.

Supported by

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