Skip to main content

this is date picker for streamlit

Project description

Streamlit DatePicker

PyPI GitHub GitHub issues GitHub pull requests

Project Introduction

streamlit-date-picker is a date picker designed for use with Streamlit. It allows users to easily select a range of dates and times. Streamlit Date Picker

Installation

Install the package using the following command:

pip install streamlit-date-picker

Usage

import streamlit as st

from streamlit_date_picker import date_range_picker, PickerType, Unit, date_picker

st.title('Streamlit Date Picker')

# Use date_range_picker to create a datetime range picker
st.subheader('Date Range Picker')
date_range_string = date_range_picker(picker_type=PickerType.time.string_value,
                                      start=-30, end=0, unit=Unit.minutes.string_value,
                                      key='range_picker',
                                      refresh_button={'is_show': True, 'button_name': 'Refresh last 30min',
                                                      'refresh_date': -30,
                                                      'unit': Unit.minutes.string_value})
if date_range_string is not None:
    start_datetime = date_range_string[0]
    end_datetime = date_range_string[1]
    st.write(f"Date Range Picker [{start_datetime}, {end_datetime}]")

st.subheader('Date Picker')
# Use date_picker to create a date picker
date_string = date_picker(picker_type=PickerType.time.string_value, value=0, unit=Unit.days.string_value,
                          key='date_picker')

if date_string is not None:
    st.write('Date Picker: ', date_string)

Parameter

Range Picker

  • picker_type: Default picker type, type: str, options: time, date, week, month, quarter, year.
  • start: Default start time, type: int, default value: -30.
  • end: Default end time, type: int, default value: 0.
  • unit: Default time unit, type: str, options: milliseconds, seconds, minutes, hours, days, weeks, months, years.
  • key: Picker key, default value: None.
  • refresh_button: Refresh button configuration, type: {'is_show': bool, 'button_name': str}, default values: False and 'Refresh last 30min'. When the button is clicked, it refreshes the selected time range.
  • The return value of datetime_range_picker is of type str.

Date Picker

  • picker_type: Default picker type, type: str, options: time, date, week, month, quarter, year.
  • value: Default value, type: int, default value: 0.
  • unit: Default time unit, type: str, options: milliseconds, seconds, minutes, hours, days, weeks, months, years.
  • key: Picker key, default value: None.

License

This project is licensed under the MIT License. See the LICENSE file 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-date-picker-0.0.2b5.tar.gz (892.1 kB view hashes)

Uploaded Source

Built Distribution

streamlit_date_picker-0.0.2b5-py3-none-any.whl (899.9 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