πŸ“½ Streamlit application powered by a PyScaffold project setup

Overview

Project generated with PyScaffold

streamlit-demo

Streamlit application powered by a PyScaffold project setup.

Work in progress: The idea of this repo is to demonstrate how to package a streamlit app using PyScaffold. Since streamlit currently doesn't support apps as proper Python packages, this example is still suboptimal. Following Github issue was created to improve the current situation.

The structure was created with:

putup --dsproject streamlit-demo -p git_overview \
      -d "Streamlit application powered by a PyScaffold project setup." \
      -u https://github.com/pyscaffold/streamlit-demo

then the actual code was taken from git-overview (MIT-licensed) and changed into a proper Python package layout.

The advantages over the original codebase are:

  1. wheel file for distribution can be easily build with tox -e build,
  2. unit tests can be easily added in the tests folder,
  3. extract-repo is now a shell command (available after installation) instead of a script repo.py,
  4. git_overview is a Python package that could be reused by other Python projects after installation,
  5. all the other advantages of a PyScaffold layout...

Installation & Running the dashboard

In order to set up the necessary environment:

  1. create and activate the environment streamlit-demo with the help of conda:
    conda env create -f environment.yml
    conda activate streamlit-demo
    or use environment.lock.yml to recreate an environment with pinned dependencies.

NOTE: The conda environment will have streamlit-demo installed in editable mode. Some changes, e.g. in setup.cfg, might require you to run pip install -e . again.

  1. run the dashboard with:

    streamlit run scripts/show_dashboard.py
  2. or (optionally) build a docker image and run it with:

    docker build -t local/streamlit-demo:latest .
    docker run -p 8501:8501 local/streamlit-demo:latest
  3. open the dashboard at http://localhost:8501.

Project Organization

β”œβ”€β”€ AUTHORS.md              <- List of developers and maintainers.
β”œβ”€β”€ CHANGELOG.md            <- Changelog to keep track of new features and fixes.
β”œβ”€β”€ CONTRIBUTING.md         <- Guidelines for contributing to this project.
β”œβ”€β”€ Dockerfile              <- Build a docker container with `docker build .`.
β”œβ”€β”€ LICENSE.txt             <- License as chosen on the command-line.
β”œβ”€β”€ README.md               <- The top-level README for developers.
β”œβ”€β”€ docs                    <- Directory for Sphinx documentation in rst or md.
β”œβ”€β”€ environment.yml         <- The conda environment file for reproducibility.
β”œβ”€β”€ pyproject.toml          <- Build configuration. Don't change! Use `pip install -e .`
β”‚                              to install for development or to build `tox -e build`.
β”œβ”€β”€ scripts                 <- Entry-script `show_dashboard.py` for streamlit
β”œβ”€β”€ setup.cfg               <- Declarative configuration of your project.
β”œβ”€β”€ setup.py                <- [DEPRECATED] obsolete way of building and installation.
β”œβ”€β”€ src
β”‚   └── git_overview        <- Actual Python package `git-overview` with the main functionality.
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ dashboard.py    <- Layout-function of the actual dashboard.
β”‚       β”œβ”€β”€ repo.py         <- Functions to download repo data.
β”‚       └── utils.py        <- Some dashboard-related helpers
β”œβ”€β”€ tests                   <- Unit tests which can be run with `pytest`.
β”œβ”€β”€ .coveragerc             <- Configuration for coverage reports of unit tests.
β”œβ”€β”€ .isort.cfg              <- Configuration for git hook that sorts imports.
└── .pre-commit-config.yaml <- Configuration of pre-commit git hooks.

This structure is in strong contrast to the original one:

β”œβ”€β”€ app
β”‚   β”œβ”€β”€ dashboard.py        <- Dashboard entry-point
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ repo.py             <- Script to download repo data
β”‚   └── utils.py            <- Some dashboard-related helpers
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ README.md
└── requirements.txt

Note

This project has been set up using PyScaffold 4.1.1.post1.dev28+g075b76f and the dsproject extension 0.6.1.post28+g91ab61a.

You might also like...
πŸ’» Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your DSA journey.πŸ“°πŸ”₯ This repository contains the REST APIs of the application.✨
πŸ’» Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your DSA journey.πŸ“°πŸ”₯ This repository contains the REST APIs of the application.✨

Algo-Phantom-Backend πŸ’» Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your D

πŸͺ„ Auto-generate Streamlit UI from Pydantic Models and Dataclasses.
πŸͺ„ Auto-generate Streamlit UI from Pydantic Models and Dataclasses.

Streamlit Pydantic Auto-generate Streamlit UI elements from Pydantic models. Getting Started β€’ Documentation β€’ Support β€’ Report a Bug β€’ Contribution β€’

Addons like multipages for streamlit webapp
Addons like multipages for streamlit webapp

streamlit_pages Installation $ pip install streamlit-pages Features Adding multiple pages to streamlit Sharing specific pages Usage import streamlit

OpenSea NFT API App using Python and Streamlit

opensea-nft-api-tutorial OpenSea NFT API App using Python and Streamlit Tutorial Video Walkthrough https://www.youtube.com/watch?v=49SupvcFC1M Instruc

Repo to demo translating colab/jupyter notebook to streamlit webapp

Repo to demo translating colab/jupyter notebook to streamlit webapp

Write Streamlit apps using Notion! (Prototype)

Streamlit + Notion test app Write Streamlit apps using Notion! ☠️ IMPORTANT: This is just a little prototype I made to play with some ideas. Not meant

A streamlit app for exploring image search results from HuggingPics

title emoji colorFrom colorTo sdk app_file pinned huggingpics-explorer πŸ€— blue red streamlit app.py false huggingpics-explorer A streamlit app for exp

A simple streamlit webapp with multiple functionality

A simple streamlit webapp with multiple functionality

Owner
PyScaffold
Python project template generator with batteries included
PyScaffold
switching computer? changing your setup? You need to automate the download of your current setup? This is the right tool for you :incoming_envelope:

?? setup_shift(SS.py) switching computer? changing your setup? You need to automate the download of your current setup? This is the right tool for you

Mohamed Elfaleh 15 Aug 26, 2022
Width-customizer-for-streamlit-apps - Width customizer for Streamlit Apps

?? Width customizer for Streamlit Apps As of now, you can only change your Strea

Charly Wargnier 5 Aug 9, 2022
Streamlit component to display topics from Streamlit's community forum related to any exception.

streamlit-forum Streamlit component to display topics from Streamlit's community forum related to any exception. Installation pip install streamlit-fo

Snehan Kekre 7 Jul 15, 2022
Runtime profiler for Streamlit, powered by pyinstrument

streamlit-profiler ???? Runtime profiler for Streamlit, powered by pyinstrument. streamlit-profiler is a Streamlit component that helps you find out w

Johannes Rieke 22 Nov 1, 2022
Hydralit package is a wrapping and template project to combine multiple independant Streamlit applications into a multi-page application.

Hydralit The Hydralit package is a wrapping and template project to combine multiple independant (or somewhat dependant) Streamlit applications into a

Jackson Storm 93 Nov 18, 2022
Python project setup, updater, and launcher

Launcher Python project setup, updater, and launcher Purpose: Increase project productivity and provide features easily. Once installed as a git submo

DAAV, LLC 1 Jan 7, 2022
Python project setup, updater, and launcher

pyLaunch Python project setup, updater, and launcher Purpose: Increase project productivity and provide features easily. Once installed as a git submo

DAAV, LLC 1 Jan 7, 2022
Sabe is a python framework written for easy web server setup.

Sabe is a python framework written for easy web server setup. Sabe, kolay web sunucusu kurulumu iΓ§in yazΔ±lmış bir python Γ§erΓ§evesidir. Γ–ΔŸrenmesi kola

null 2 Jan 1, 2022
SpaCy3Urdu: run command to setup assets(dataset from UD)

Project setup run command to setup assets(dataset from UD) spacy project assets It uses project.yml file and download the data from UD GitHub reposito

Muhammad Irfan 1 Dec 14, 2021
MoBioTools A simple yet versatile toolkit to automatically setup quantum mechanics/molecular mechanics

A simple yet versatile toolkit to setup quantum mechanical/molecular mechanical (QM/MM) calculations from molecular dynamics trajectories.

MoBioChem 16 Oct 6, 2022