Registry / testing / streamlit-faker

streamlit-faker

JSON →
library0.0.4pypypi✓ verified 90d ago

streamlit-faker is a Python library designed to easily fake Streamlit commands. It allows developers to quickly draft a user interface or use it as a QA tool by generating random parameters for Streamlit functions, streamlining the prototyping process. It is built upon the popular `faker` project. The current version is 0.0.4, and it has an active, though not rapid, release cadence.

pip install streamlit-faker
INSTALL
IMPORT
SIG · STREAMLIT-FAKER
S
streamlit-faker
testingpythonv0.0.4
Install
20.1s avg
Import
6179ms
Disk
527MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 6.694s · 536.7MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 20.1s · import 5.664s · 501MB
527MB installed
● package 527MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_streamlit_faker
✓ from streamlit_faker import get_streamlit_faker
✗ import streamlit_faker
The primary entry point is the `get_streamlit_faker` function, not the module itself.

This quickstart demonstrates how to instantiate `streamlit-faker` and use it to render various Streamlit UI elements with randomly generated content. Run this script with `streamlit run your_app.py`.

import streamlit as st from streamlit_faker import get_streamlit_faker st.title("Streamlit Faker Demo") st_faker = get_streamlit_faker(seed=42) # Optional: set a seed for reproducible fake data st.subheader("Faked UI Elements:") st_faker.markdown() st_faker.selectbox() st_faker.slider() st_faker.map() st_faker.button("Faked Button") st.info("This entire section was generated with fake data using streamlit-faker.")
Debug
Known issues
gotchastreamlit-faker is primarily designed for rapid prototyping and UI drafting. It generates plausible, but random, data and may not accurately reflect complex real-world Streamlit app behavior, especially concerning intricate user interactions, state management, or custom components.
fix
Use for initial layout and visual feedback. For robust testing or complex logic, implement actual Streamlit components with specific test data or a dedicated testing framework.
affects: All versions
gotchaWhen migrating from faked UI to real Streamlit components, ensure proper handling of widget keys (`key` parameter) and `st.session_state` to prevent unexpected behavior. The faked commands automatically handle some aspects, which need manual attention in real code.
fix
Carefully review and explicitly define `key` arguments for stateful widgets and manage application state via `st.session_state` when replacing `streamlit-faker` calls with actual Streamlit API calls.
affects: All versions
deprecatedPrior to v0.0.4, the library internally relied on `streamlit-extras`. This dependency was replaced with `altex`. While this was primarily an internal change, users relying on any indirectly exposed `streamlit-extras` functionality might need to adjust their assumptions about underlying components.
fix
Upgrade to v0.0.4 or later. Ensure your application does not directly or indirectly depend on `streamlit-extras` features that might have been implicitly provided by older `streamlit-faker` versions.
affects: <0.0.4
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'streamlit_faker'
The `streamlit-faker` package is not installed in the current Python environment.
fix
Run `pip install streamlit-faker` to install the library.
AttributeError: 'StreamlitFaker' object has no attribute 'non_existent_command'
Attempting to call a Streamlit command that does not exist or is not supported by the `streamlit-faker` wrapper.
fix
Verify the Streamlit command name against the official Streamlit documentation. `streamlit-faker` aims to support common Streamlit commands but might not cover all edge cases or newly introduced APIs immediately.
Upgrade
Version history
0.0.4latest on PyPI · released Jul 1, 2025
Audit
Dependencies
fakerrequiredCore dependency for generating diverse fake data patterns for Streamlit commands.
streamlitrequiredThe underlying framework whose commands are being faked.
Agent activity
16 hits · last 30 days
node
12
Resources
streamlit-faker — pip install streamlit-faker · libregistry