Skip to main content

Streamlit text_area autocomplete using streamlit-textcomplete

Project description

streamlit_autocomplete

A simple Python package for adding autocomplete functionality to a Streamlit app’s st.text_area, using streamlit-textcomplete.

Features

  • Fast, case‑insensitive autocomplete as you type
  • Works with any list of strings (cities, stock names, etc.)
  • Clean, minimal API for Streamlit

Installation

pip install streamlit-autocomplete

Note: streamlit and streamlit-textcomplete are installed automatically as dependencies.


Usage

import streamlit as st
from streamlit_autocomplete import st_textcomplete_autocomplete

# Autocomplete options
city_names = [
    "New York", "London", "Paris", "Berlin", "Tokyo", "Mumbai",
    # ...more
]

query = st_textcomplete_autocomplete(
    label="Enter city or metric",
    options=city_names,
    key="city_autocomplete",
    help="Start typing a city name"
)

st.write("You typed:", query)

API

Parameter Type Description
label str Label for the text area
options list List of strings for autocomplete
key str Streamlit key (use different keys for multiple fields)
placeholder str Placeholder text (optional)
height int Text area height (optional, default 120)
help str Help tooltip (optional)
max_count int Maximum suggestions to display (default 10)

Returns: str – the current typed/autocompleted string.


License

MIT License


Credits

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_autocomplete-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

streamlit_autocomplete-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_autocomplete-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit_autocomplete-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for streamlit_autocomplete-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef432e770e63febfff24de189189cfccd80198ac2ba0f7659592bc756182c3a8
MD5 8eabdf44b2d77ffc9f7f0967d3ac6f06
BLAKE2b-256 85612573cb7b66fbeb703dd2a8980ae2467291e6007662b5413517358486bc85

See more details on using hashes here.

File details

Details for the file streamlit_autocomplete-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_autocomplete-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 518ebcf4c71f8be265cf12d032de9744598e67af67a8af68bc1ef386b14adc70
MD5 a8d0476f3dccf4449b36922fd661b1ac
BLAKE2b-256 a9ef391e35f8931bdd74cff038ce2c1e5443ebbcd8aee9297f4d4354f8c44d70

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