diff --git a/Dockerfile b/Dockerfile index c2ba423d..a7342bf2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf + ENV LANG C.UTF-8 ADD . /opt/program/ diff --git a/src/streamlit_app.py b/src/streamlit_app.py index 22cfaa7f..e26b7c48 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -4,6 +4,7 @@ import os import configparser import urllib +import datetime from time import sleep from pathlib import Path from threading import Thread @@ -41,7 +42,16 @@ def check_updates(): def show_df_as_result_table(): try: df = pd.read_pickle('last_screened_unformatted_results.pkl') - st.markdown(f'#### 🔍 Found {len(df)} Results') + ac, bc = st.columns([6,1]) + ac.markdown(f'#### 🔍 Found {len(df)} Results') + bc.download_button( + label="Download Results", + data=df.to_csv().encode('utf-8'), + file_name=f'screenipy_results_{datetime.datetime.now().strftime("%H:%M:%S_%d-%m-%Y")}.csv', + mime='text/csv', + type='secondary', + use_container_width=True + ) df.index = df.index.map(lambda x: "https://in.tradingview.com/chart?symbol=NSE%3A" + x) df.index = df.index.map(lambda x: f'{x.split("%3A")[-1]}') df['Stock'] = df.index