The purpose of this repository is to provide an initial project template for Streamlit apps that simplifies and speeds up development.
To use the tamplate first clone this repository.
git clone https://github.com/pixpack/streamlit-base.git my-streamlit-appMove into the templates directory.
cd my-streamlit-appOn Github you can also click the Use this template button to automatically create
your own repository based on this template.
Create a virtual environment.
python -m venv .venvActivate the virtual environment.
On Linux, macOS.
source .venv/bin/activateOn Windows (Powershell).
.venv/Scripts/Activate.ps1Get the development dependencies.
python -m pip install --upgrade pip && \
pip install -r requirements-dev.txtStart editing the app files in the app directory with your favourite editor.
For more information on how to develop Streamlit apps, check Streamlit documentation.
Start the app with the streamlit run command.
streamlit run app/main.pyRun the tests.
pytestFor more information on testing, visit pytest documentation.
The template is set up with Docker to deploy the app.
Configure the streamlit config.toml to your needs.
When changing the default ports in the configuration, remember to also change them in
docker runcommand.
Build the Docker image.
docker build -t streamlit-app .Run the container.
docker run -dp 8501:8501 streamlit-appContributions are very welcome.
To contribute:
- Create an issue you would like to work on.
- Fork the repository.
- Create a pull request and attach the issue.
The initial streamlit config comes from the great Awesome Streamlit repository.