From dc660f481cec13439639e5f75fdbba1b0ae5945e Mon Sep 17 00:00:00 2001 From: Oleh Omelchenko Date: Thu, 20 Jun 2024 00:54:13 +0300 Subject: [PATCH] init --- .gitignore | 1 + .python-version | 1 + Makefile | 35 +++++++++++++++++++++++++++++++++++ app.py | 5 +++++ readme.md | 15 +++++++++++++++ requirements.txt | 1 + 6 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 .python-version create mode 100644 Makefile create mode 100644 app.py create mode 100644 readme.md create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..2c07333 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..17a213a --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +# Define the virtual environment directory +VENV_DIR = venv + +# Define the requirements file +REQUIREMENTS_FILE = requirements.txt + +# Create the virtual environment +$(VENV_DIR): + python3 -m venv $(VENV_DIR) + +# Activate the virtual environment and install requirements +.PHONY: install +install: $(VENV_DIR) + $(VENV_DIR)/bin/pip install --upgrade pip + $(VENV_DIR)/bin/pip install -r $(REQUIREMENTS_FILE) + +# Clean the virtual environment +.PHONY: clean +clean: + rm -rf $(VENV_DIR) + +# Run a command inside the virtual environment +.PHONY: run +run: + $(VENV_DIR)/bin/python -m some_module + +# Example of running a script inside the virtual environment +.PHONY: run-script +run-script: + $(VENV_DIR)/bin/python script.py + +# Run a Streamlit app inside the virtual environment +.PHONY: run-streamlit +run-streamlit: + $(VENV_DIR)/bin/streamlit run app.py --server.address=127.0.0.1 diff --git a/app.py b/app.py new file mode 100644 index 0000000..0f4dc8c --- /dev/null +++ b/app.py @@ -0,0 +1,5 @@ +import streamlit as st + + +st.markdown("# Hello World") + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..3b4e1f1 --- /dev/null +++ b/readme.md @@ -0,0 +1,15 @@ +## Demo of Streamlit interactive dashboard + +to install dependencies: + +``` +python3 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +to run locally: + +``` +streamlit run app.py --server.address=127.0.0.1 +``` diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e251330 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +streamlit \ No newline at end of file