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.dateobject
📦 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
- ✅ Green: Clickable, available in
-
When a user clicks a green date, the widget returns the corresponding
datetime.dateobject.
📌 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_calendar_input-0.0.2.tar.gz.
File metadata
- Download URL: streamlit_calendar_input-0.0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a29c5cdce46ae94c0fec010d3fd5379d0e88b914998ea5654cd95706898ec54c
|
|
| MD5 |
9b4ca9de99bd8d5b72b5ee7b100e6b01
|
|
| BLAKE2b-256 |
ce494fe23940232eafcb43e32f03a481aead20a74b9d1b4fd224983728390758
|
File details
Details for the file streamlit_calendar_input-0.0.2-py3-none-any.whl.
File metadata
- Download URL: streamlit_calendar_input-0.0.2-py3-none-any.whl
- Upload date:
- Size: 125.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc143b7b07bcbaa9093401b28f6e0b295ce590366edddb2842ba9b4c5d2671a5
|
|
| MD5 |
fb54df37b273ebadbe4110444ff47603
|
|
| BLAKE2b-256 |
88caddd58003da2f625b455bb2fd2036055d4e4aceba22439adc8240cac6a21e
|