Skip to content

Commit

Permalink
wip - download results button added, Docker DNS changed to 8.8.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjal-joshi committed Oct 8, 2023
1 parent 6d23232 commit c7842b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
12 changes: 11 additions & 1 deletion src/streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import configparser
import urllib
import datetime
from time import sleep
from pathlib import Path
from threading import Thread
Expand Down Expand Up @@ -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'<a href="{x}" target="_blank">{x.split("%3A")[-1]}</a>')
df['Stock'] = df.index
Expand Down

0 comments on commit c7842b6

Please sign in to comment.