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:
streamlitandstreamlit-textcompleteare 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
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_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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef432e770e63febfff24de189189cfccd80198ac2ba0f7659592bc756182c3a8
|
|
| MD5 |
8eabdf44b2d77ffc9f7f0967d3ac6f06
|
|
| BLAKE2b-256 |
85612573cb7b66fbeb703dd2a8980ae2467291e6007662b5413517358486bc85
|
File details
Details for the file streamlit_autocomplete-0.1.0-py3-none-any.whl.
File metadata
- Download URL: streamlit_autocomplete-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
518ebcf4c71f8be265cf12d032de9744598e67af67a8af68bc1ef386b14adc70
|
|
| MD5 |
a8d0476f3dccf4449b36922fd661b1ac
|
|
| BLAKE2b-256 |
a9ef391e35f8931bdd74cff038ce2c1e5443ebbcd8aee9297f4d4354f8c44d70
|