# go_my_streamlit_awesome_streamlit **Repository Path**: coding_net_cloud_studio/go_my_streamlit_awesome_streamlit ## Basic Information - **Project Name**: go_my_streamlit_awesome_streamlit - **Description**: 10_各种awesome很适合club 20_https://github.com/MarcSkovMadsen/awesome-streamlit.git - **Primary Language**: Python - **License**: CC0-1.0 - **Default Branch**: wmstudy - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-12-31 - **Last Updated**: 2024-06-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Awesome Streamlit [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/MarcSkovMadsen/awesome-streamlit) [](https://streamlit.io) > The fastest way to build **Awesome Tools and Apps**! Powered by **Python**! The purpose of this project is to share knowledge on how Awesome [Streamlit](https://streamlit.io/) is and can become. [Pull requests](https://github.com/MarcSkovMadsen/awesome-streamlit/pulls) are very welcome! Streamlit has just been [announced](https://towardsdatascience.com/coding-ml-tools-like-you-code-ml-models-ddba3357eace) (Oct 2019) but I see the potential of becoming the **Iphone of Data Science Apps**. And maybe it can even become the Iphone of Technical Writing, Code, Micro Apps and Python. This project provides - A curated [list](https://github.com/MarcSkovMadsen/awesome-streamlit#awesome-resources) of Awesome Streamlit **resources**. See below. - An [**awesome Streamlit application**](https://awesome-streamlit.org) with a **gallery** of Awesome Streamlit Apps. - Feel free to add your awesome app to the gallery via a [Pull request](https://github.com/MarcSkovMadsen/awesome-streamlit/pulls). It's easy (see below). - A [**vision**](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/AWESOME-STREAMLIT.md) on how awesome Streamlit is and can become. - A **best practices** example and **starter template** of an awesome, multipage app with an automated CI/ CD pipeline, deployed to the cloud and running in a Docker container. Visit the app at [awesome-streamlit.org](https://awesome-streamlit.org)! ![Awesome Streamlit Org Animation](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/awesome-streamlit-full-branded.gif?raw=true) ## The Magic of Streamlit The only way to truly understand how magical Streamlit is to play around with it. But if you need to be convinced first, then here is the **4 minute introduction** to Streamlit! Afterwards you can go to the [Streamlit docs](https://streamlit.io/docs/) to get started. You might also visit [Awesome Streamlit docs](https://awesome-streamlit.readthedocs.io/en/latest/). [![Introduction to Streamlit](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/youtube-introduction-to-streamlit.png?raw=true)](https://www.youtube.com/watch?v=B2iAodr0fOo&feature=youtu.be "Introduction to streamlit") ## Awesome Resources A curated list of awesome streamlit resources. Inspired by [awesome-python](https://github.com/vinta/awesome-python) and [awesome-pandas](https://github.com/tommyod/awesome-pandas). ### Alternative - [Bokeh](https://bokeh.pydata.org/en/latest/index.html) (#Alternative) - [Jupyter Voila](https://blog.jupyter.org/and-voil%C3%A0-f6a2c08a4a93) (#Alternative) - [Panel](http://panel.pyviz.org/) (#Alternative) - [Plotly Dash](https://plot.ly/dash/) (#Alternative) ### App - [Hello-streamlit deployed on Glitch](https://glitch.com/~hello-streamlit) by [Alexander Garcia](https://github.com/djauxel) (#App, #Deployment) - [How to create and deploy data exploration web app easily using python](https://github.com/robmarkcole/mqtt-camera-streamer) (#App, #Code, #Deployment) - [Kaggle Mushrooms Dashboard](https://github.com/pierpaolo28/Data-Visualization/tree/master/Streamlit) (#App) - [NLP Based App with Streamlit](https://github.com/Jcharis/Streamlit_DataScience_Apps/tree/master/NLP_App_with_Streamlit_Python) by [Jesse E. Agbe (JCharis)](https://github.com/Jcharis) (#App, #Code) - [Powering up Apache JMeter with Streamlit](https://qainsights.com/apache-jmeter-with-streamlit-for-machine-learning/) by [Naveen Kumar](https://github.com/QAInsights) (#App, #Code) - [Quickly Build and Deploy a Dashboard with Streamlit](https://towardsdatascience.com/quickly-build-and-deploy-an-application-with-streamlit-988ca08c7e83) by [Maarten Grootendorst](https://github.com/MaartenGr) (#App, #Code, #Deployment) - [Sentiment Analyzer Tool](https://www.linkedin.com/posts/patidarparas13_code-ml-machinelearning-ugcPost-6585745929062703104-ttkv) (#App, #Code, #Social) - [Streamlit Demo](https://github.com/Poseyy/StreamlitDemo) by [Luke Posey](https://github.com/Poseyy) (#App, #Code) - [Streamlit-components-demo App](https://fullstackstation.com/streamlit-components-demo) (#App) - [Deploying web apps with Streamlit, Docker, and AWS](https://github.com/collinprather/streamlit-docker/tree/docker-compose+postgres) by [Collin Prather](https://github.com/collinprather) (#App, #Code) ### Article - [Intermediate Streamlit - Tips and Tricks for an evolving app](https://towardsdatascience.com/intermediate-streamlit-d5a1381daa65) by [Peter Baumgartner](https://pmbaumgartner.github.io/) (#Article) ### Awesome-Streamlit.org - [App](https://awesome-streamlit.org) by [Awesome-Streamlit.org](https://github.com/marcskovmadsen/awesome-streamlit) (#Awesome-Streamlit.org) - [Docker Image](https://cloud.docker.com/u/marcskovmadsen/repository/docker/marcskovmadsen/awesome-streamlit) by [Awesome-Streamlit.org](https://github.com/marcskovmadsen/awesome-streamlit) (#Awesome-Streamlit.org) - [Docs](https://awesome-streamlit.readthedocs.io/en/latest/) by [Awesome-Streamlit.org](https://github.com/marcskovmadsen/awesome-streamlit) (#Awesome-Streamlit.org) - [LinkedIn post that started awesome-streamlit.org](https://www.linkedin.com/feed/update/urn:li:activity:6586497522896818176) (#Awesome-Streamlit.org, #Social) - [Python Package](https://pypi.org/project/awesome-streamlit/) by [Awesome-Streamlit.org](https://github.com/marcskovmadsen/awesome-streamlit) (#Awesome-Streamlit.org) - [Repo](https://github.com/marcskovmadsen/awesome-streamlit) by [Awesome-Streamlit.org](https://github.com/marcskovmadsen/awesome-streamlit) (#Awesome-Streamlit.org) - [Resources List](https://github.com/marcskovmadsen/awesome-streamlit) by [Awesome-Streamlit.org](https://github.com/marcskovmadsen/awesome-streamlit) (#Awesome-Streamlit.org) ### Code - [Awesome Streamlit Test Runner](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/test_runner_app/test_runner_app.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Bokeh Experiments](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/bokeh_experiments/bokeh_experiments.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Country Indicators](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/country_indicators/streamlit_country_indicators.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code, #Voila) - [Deploying Streamlit app to EC2 instance](https://medium.com/@pokepim/deploying-streamlit-app-to-ec2-instance-7a7edeffbb54) (#Code) - [Emojis](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/emojis/emojis.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [File Download Workaround](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/file_download/file_download.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [File Uploader](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/file_uploader/file_uploader.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [File Uploader - Multiple Files](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/file_uploader_multiple_files/file_uploader_multiple_files.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Image Classifier](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/image_classifier/image_classifier.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Iris Classifier](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/iris_classification/iris.py) by [Noah Saunders](https://morioh.com/p/7066169a0314) (#App In Gallery, #Code, #Machine Learning) - [Iris EDA App](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/iris_eda_app/iris_eda_app.py) by [Jesse E. Agbe (JCharis)](https://github.com/Jcharis) (#App In Gallery, #Code) - [Kickstarter Dashboard](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/kickstarter_dashboard/kickstarter_dashboard.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Layout Experiments](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/layout_experiments/app.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [ML App registry](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/ml_app_registry/app.py) by [Boadzie Daniel](https://github.com/Boadzie) (#App In Gallery, #Code, #Machine Learning) - [Medical Language Learner Model](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/medical_language_learner/medical_language_learner.py) by [Georgi Tancev](https://github.com/gtancev) (#App In Gallery, #Code, #NLP) - [Mining and Classifying Medical Text Documents](https://github.com/gtancev/MLML/blob/master/nlp_app.py) by [Georgi Tancev](https://github.com/gtancev) (#App, #Code) - [NBA Roster Turnover](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/nba_roster_turnover/roster_turnover.py) by [Kevin Arvai](https://github.com/arvkevi) (#App In Gallery, #Code) - [Owid Dashboard](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/owid_dashboard/owid_dashboard.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Self Driving Cars](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/self_driving_cars/self_driving_cars.py) by [Streamlit](https://streamlit.io/) (#App In Gallery, #Code) - [Sentiment Algorithm](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/sentiment_analyzer/sentiment_analyzer.py) by [Paras Patidar](https://github.com/patidarparas13) (#App In Gallery, #Code, #Machine Learning) - [SpacyIO](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/spacyio/spacyio.py) by [Ines Montani](https://gist.github.com/ines) (#App In Gallery, #Code, #NLP) - [Spreadsheet](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/spreadsheet/spreadsheet.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Streamlit-components-demo Code](https://github.com/virusvn/streamlit-components-demo) (#Code) - [Table Experiments](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/table_experiments/app.py) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#App In Gallery, #Code) - [Uber Data Explorer App](https://dataexplorerlit.herokuapp.com/) (#Code) - [Uber NYC Pickups](https://raw.githubusercontent.com/streamlit/demo-uber-nyc-pickups/master/app.py) by [Streamlit](https://streamlit.io/) (#App In Gallery, #Code) - [Yahoo Finance](https://raw.githubusercontent.com/MarcSkovMadsen/awesome-streamlit/master/gallery/yahoo_finance_app/yahoo_finance_app.py) by [Paduel](https://github.com/paduel) (#App In Gallery, #Code, #Finance) ### Guide - [Host Streamlit on Heroku with Nginx basic authentication](https://github.com/Taxuspt/heroku_streamlit_nginx) by [Alexandre Domingues](https://github.com/Taxuspt) (#Code, #Guide) ### Sister Sites - [Awesome-Panel.Org](https://awesome-panel.org) by [Marc Skov Madsen](https://datamodelsanalytics.com) (#Sister Sites) ### Social - [LinkedIn #streamlit](https://www.linkedin.com/search/results/all/?keywords=%23streamlit) (#Social) - [Twitter #streamlit](https://twitter.com/search?q=%23streamlit&src=typed_query) (#Social) ### Streamlit.io - [Streamlit Community](https://discuss.streamlit.io/top/quarterly) (#Streamlit.io) - [Streamlit Docs](https://streamlit.io/docs/) (#Streamlit.io) - [Streamlit launches article in TechCrunch](https://techcrunch.com/2019/10/01/streamlit-launches-open-source-machine-learning-application-development-framework/) (#Streamlit.io) - [Streamlit.io](https://streamlit.io/) (#Streamlit.io) - [The announcing blog](https://towardsdatascience.com/coding-ml-tools-like-you-code-ml-models-ddba3357eace) (#Streamlit.io) - [The announcing community post](https://discuss.streamlit.io/t/streamlit-has-launched/105/3) (#Streamlit.io) ### Technical - [Hacker News technical discussion of how Streamlit work](https://news.ycombinator.com/item?id=21158487) (#Technical) ### Tutorial - [A step by step guide to running streamlit pytorch and bert on a cheap aws instance](https://fuzzyblog.io/blog/python/2019/10/17/a-step-by-step-guide-to-running-streamlit-pytorch-and-bert-on-a-cheap-aws-instance.html) (#Article, #Deployment, #Tutorial) - [Building a ui for your latest ai](https://towardsdatascience.com/full-stack-ai-building-a-ui-for-your-latest-ai-project-in-no-time-at-all-7e5c8fd4eafd ) by [Luke Posey](https://github.com/Poseyy) (#Article, #Tutorial) - [Building an Iris EDA App with Streamlit and Python](https://www.youtube.com/watch?v=L_mZcEMFUIc) by [Jesse E. Agbe (JCharis)](https://github.com/Jcharis) (#Tutorial, #Video) - [Full-Stack AI: Building a UI for Your Latest AI Project in No Time at All](https://towardsdatascience.com/full-stack-ai-building-a-ui-for-your-latest-ai-project-in-no-time-at-all-7e5c8fd4eafd) (#Article, #Image Recognition, #Tutorial) - [How To Deploy Streamlit Apps (Using Heroku)](https://www.youtube.com/watch?v=skpiLtEN3yk&feature=youtu.be) (#Deployment, #Tutorial, #Video) - [How to build your machine learning app in 3 simple steps](https://towardsdatascience.com/how-to-build-your-machine-learning-app-in-3-simple-steps-d56ed910355c) (#Article, #Deployment, #Tutorial) - [How to create and deploy data exploration web app easily using python](https://medium.com/@ansjin/how-to-create-and-deploy-data-exploration-web-app-easily-using-python-a03c4b8a1f3e) (#Article, #Deployment, #Tutorial) - [How to write web apps using simple python for data scientists](https://towardsdatascience.com/how-to-write-web-apps-using-simple-python-for-data-scientists-a227a1a01582) (#Article, #Tutorial) - [Mining and Classifying Medical Text Documents](https://towardsdatascience.com/mining-and-classifying-medical-text-documents-1876462f73bc) by [Georgi Tancev](https://github.com/gtancev) (#Article, #Deployment, #NLP, #Tutorial) - [Streamlit Python Tutorial (Crash Course)](https://www.youtube.com/watch?v=_9WiB2PDO7k) by [Jesse E. Agbe (JCharis)](https://github.com/Jcharis) (#Tutorial, #Video ## Governance This repo is maintained by me :-) I'm Marc, Skov, Madsen, PhD, CFA®, Lead Data Scientist Developer at [Ørsted](https://orsted.com) You can learn more about me at [datamodelsanalytics.com](https://datamodelsanalytics.com) [](https://datamodelsanalytics.com) I try my best to govern and maintain this project in the spirit of the [Zen of Python](https://www.python.org/dev/peps/pep-0020/). But **i'm not an experienced open source maintainer** so helpfull suggestions are appreciated. Thanks ## Contribute GitHub [Issues](https://github.com/MarcSkovMadsen/awesome-streamlit/issues) and [Pull requests](https://github.com/MarcSkovMadsen/awesome-streamlit/pulls) are very welcome! If you believe Awesome Streamlit is awesome and would like to join as a Core Developer feel free to reach out via [datamodelsanalytics.com](https://datamodelsanalytics.com) ### How to contribute awesome links The best way to contribute an awesome link is via a [Pull request](https://github.com/MarcSkovMadsen/awesome-streamlit/pulls). In the pull request you should - describe why your contribution is awesome and should be included. - add your resource the list of RESOURCES in the [package/awesome_streamlit/database/resources.py](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/package/awesome_streamlit/database/resources.py) file. Thanks. ### How to contribute awesome apps The best way to contribute an awesome app is via a [Pull request](https://github.com/MarcSkovMadsen/awesome-streamlit/pulls). In the pull request you should - describe why your contribution is awesome and should be included. - create a new folder `gallery/` and app file `gallery//`. - Add your app code conforming to the template ```python """ ## APP NAME DESCRIPTION Author: [YOUR NAME](https://URL_TO_YOU))\n Source: [Github](https://github.com/URL_TO_CODE) """ import streamlit as st # Your imports goes below def main(): st.title("APP NAME") st.markdown("DESCRIPTION") # Your code goes below if __name__ == "__main__": main() ``` - Please note magic in sub pages does not work. So **don't use magic**. - add the `your_app_name` to the - list of APPS_IN_GALLERY in the [package\awesome_streamlit\database\apps_in_gallery.py](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/package\awesome_streamlit\database\apps_in_gallery.py). - update the [requirements_base.txt](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/requirements_base.txt) file. Please specify the required versions. - Run the automated tests using `invoke test.all` and fix all errors from your app - Run the full app via `streamlit run app.py` and manually test your contribution. Please note that your app should not require high compute power as we are running on one of the cheapest tiers available on Azure. Feel free to reach out if you have comments, questions or need help. Thanks. ### How to contribute to the Streamlit Community Please sign up to and participate in the community at [discuss.streamlit.io](https://discuss.streamlit.io/) ### How to contribute to the Streamlit Package Please contribute to improving the Streamlit package at [GitHub/streamlit/streamlit](https://github.com/streamlit/streamlit) ### How to contribute to Streamlit.io Streamlit.io is in the position of trying to balance building an awesome, succesfull business and providing an awesome product to the open source community. If you are in a Team please consider signing up for the beta of - [Streamlit for teams](https://streamlit.io/forteams/) ### How to sponsor the Awesome Streamlit project If you would like to sponsor my time or the infrastructure the platform is running on, feel free to reach out via [datamodelsanalytics.com](https://datamodelsanalytics.com). You can also appreciate the work I have already done if you [![Buy me a coffee](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/buymeacoffee.png?raw=true)](https://www.buymeacoffee.com/4jlTzBJyQ) Thanks Marc ## LICENSE [Attribution-ShareAlike 4.0 International](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/license.md) ## Getting Started with the Awesome Streamlit Repository ### Prerequisites - An Operating System like Windows, OsX or Linux - A working [Python](https://www.python.org/) installation. - We recommend using 64bit Python 3.7.4. - a Shell - We recommend [Git Bash](https://git-scm.com/downloads) for Windows 8.1 - We recommend [wsl](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) for For Windows 10 - an Editor - We recommend [VS Code](https://code.visualstudio.com/) (Preferred) or [PyCharm](https://www.jetbrains.com/pycharm/). - The [Git cli](https://git-scm.com/downloads) ### Installation Clone the repo ```bash git clone https://github.com/MarcSkovMadsen/awesome-streamlit.git ``` cd into the project root folder ```bash cd awesome-streamlit ``` #### Create virtual environment ##### via python Then you should create a virtual environment named .venv ```bash python -m venv .venv ``` and activate the environment. On Linux, OsX or in a Windows Git Bash terminal it's ```bash source .venv/Scripts/activate ``` or alternatively ```bash source .venv/bin/activate ``` In a Windows terminal it's ```bash .venv/Scripts/activate.bat ``` ##### or via anaconda Create virtual environment named awesome-streamlit ```bash conda create -n awesome-streamlit python=3.7.4 ``` and activate environment. ```bash activate awesome-streamlit ``` If you are on windows you need to install some things required by GeoPandas by following [these instructions](https://geoffboeing.com/2014/09/using-geopandas-windows/). Then you should install the local requirements ```bash pip install -r requirements_local.txt ``` Finally you need to install some [spacy](https://spacy.io/) dependencies ```bash python -m spacy download en_core_web_sm python -m spacy download en_core_web_md python -m spacy download de_core_news_sm ``` ### Build and run the Application Locally ```bash streamlit run app.py ``` or as a Docker container via ```bash invoke docker.build --rebuild invoke docker.run-server ``` ### Run the Application using the image on Dockerhub If you don't wan't to clone the repo and build the docker container you can just use `docker run` to run the image from [Dockerhub](https://cloud.docker.com/u/marcskovmadsen/repository/docker/marcskovmadsen/awesome-streamlit) To run bash interactively ```bash docker run -it -p 80:80 --entrypoint "/bin/bash" marcskovmadsen/awesome-streamlit:latest ``` To run the streamlit interactively on port 80 ```bash docker run -it -p 80:80 --entrypoint "streamlit" marcskovmadsen/awesome-streamlit:latest run app.py ``` ### Code quality and Tests We use - [isort](https://pypi.org/project/isort/) for sorting import statements - [autoflake](https://github.com/myint/autoflake) to remove unused imports and unused variables - [black](https://pypi.org/project/black/) the opinionated code formatter - [pylint](https://www.pylint.org/) for static analysis - [mypy](https://github.com/python/mypy) for static type checking - [pytest](https://github.com/pytest-dev/pytest) for unit to functional tests to ensure a high quality of our code and application. You can run all tests using ```bash invoke test.all ``` ### Streamlit Tests I've created a first version of an awesome streamlit test runner. You run it via ```bash streamlit run test_runner_app.py ``` or in Docker ```bash docker run -it -p 80:80 --entrypoint "streamlit" marcskovmadsen/awesome-streamlit:latest run test_runner_app.py ``` ![Awesome Streamlit Test Runner](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/awesome-streamlit-test-runner.png?raw=true) ### Workflow We use the power of [Invoke](http://www.pyinvoke.org/) to semi-automate the local workflow. You can see the list of available commands using ```bash $ invoke --list Available tasks: docker.build Build Docker image docker.push Push the Docker container docker.run Run the Docker container interactively. docker.run-server Run the Docker container interactively docker.system-prune The docker system prune command will free up space test.all (test.pre-commit, test.test) Runs isort, autoflake, black, pylint, mypy and pytest test.autoflake Runs autoflake to remove unused imports on all .py files recursively test.bandit Runs Bandit the security linter from PyCQA. test.black Runs black (autoformatter) on all .py files recursively test.isort Runs isort (import sorter) on all .py files recursively test.mypy Runs mypy (static type checker) on all .py files recursively test.pylint Runs pylint (linter) on all .py files recursively to identify coding errors test.pytest Runs pytest to identify failing tests ``` ### Configuration You can configure the app in the `config.py` file. Please note that Streamlit has its own config files in the `~/.streamlit` folder. ### CI/ CD and Hosting The application is - build as a Docker image and tested via Azure Pipelines builds - You find the Dockerfiles [here](https://github.com/MarcSkovMadsen/awesome-streamlit/tree/master/devops/docker) and the Azure pipelines yml files [here](https://github.com/MarcSkovMadsen/awesome-streamlit/tree/master/devops/azure-pipelines) ![Azure Pipelines](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/azure-pipeline.png?raw=true) - pushed to the Dockerhub repository [marcskovmadsen/awesome-streamlit](https://cloud.docker.com/u/marcskovmadsen/repository/docker/marcskovmadsen/awesome-streamlit). ![Dockerhub](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/dockerhub.png?raw=true) - released via Azure Pipelines ![Azure Pipelines](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/azure-pipeline-release.png?raw=true) - to a web app for containers service on Azure on the cheapest non-free pricing tier ![Azure Pipelines](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/assets/azure-pricing-tier.png?raw=true) ### The Awesome-Streamlit Package You can build the package using ```bash cd package python setup.py sdist bdist_wheel ``` If you wan't to publish the package to PyPi you should first update the version number in the setup.py file. The format is `YYYYmmdd.version`. For example `20191014.2` Then you run ```bash twine upload dist/awesome-streamlit-YYYYmmdd.version.tar.gz -u -p ``` For more info see the package [README.md](https://github.com/MarcSkovMadsen/awesome-streamlit/blob/master/package/README.md) ### Project Layout The basic layout of a application is as simple as ```bash . └── app.py ``` As our application grows we would refactor our app.py file into multiple folders and files. - *assets* here we keep our css and images assets. - *models* - Defines the layout of our data in the form of - Classes: Name, attribute names, types - DataFrame Schemas: column and index names, dtypes - SQLAlchemy Tables: columns names, types - *pages* - Defines the different pages of the Streamlit app - *services* - Organizes and shares business logic, models, data and functions with different pages of the Streamlit App. - Database interactions: Select, Insert, Update, Delete - REST API interactions, get, post, put, delete - Pandas transformations and end up with a project structure like ```bash . ├── app.py └── src └── assets | └── css | | ├── app.css | | ├── component1.css | | ├── component2.css | | ├── page1.css | | └── page2.css | └── images | | ├── image1.png | | └── image2.png ├── core | └── services | ├── service1.py | └── service2.py └── pages | └── pages | ├── page1.py | └── page2.py └── shared └── models | ├── model1.py | └── model2.py └── components ├── component1.py └── component2.py ``` Further refactoring is guided by by [this](https://itnext.io/choosing-a-highly-scalable-folder-structure-in-angular-d987de65ec7) blog post and the [Angular Style Guide](https://angular.io/guide/styleguide). We place our tests in a `test` folder in the root folder organized with folders similar to the `app` folder and file names with a `test_` prefix. ```bash . └── test ├── test_app.py ├── core | └── services | ├── test_service1.py | └── test_service2.py └── pages | └── pages | ├── page1 | | └── test_page1.py | └── page2 └── shared └── models | ├── test_model1.py | └── test_model2.py └── components ├── test_component1.py └── test_component2.py ```