freemt
commited on
Commit
·
e26e536
1
Parent(s):
66b6c9c
Bump version from 0.1.1 to 0.1.2-alpha.0
Browse files- app-.py +140 -0
- app.py +51 -6
- app1.py +185 -0
- litbee/__init__.py +1 -1
- litbee/app.py +1 -1
- litbee/fetch_upload.py +101 -47
- litbee/info.py +51 -0
- litbee/multipage.py +65 -0
- litbee/options.py +1 -2
- litbee/settings.py +61 -0
- litbee/utils.py +180 -0
- poetry.lock +16 -1
- pyproject.toml +2 -1
- run-nodemon.sh +1 -1
app-.py
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Prep __main__.py.
|
| 2 |
+
|
| 3 |
+
https://share.streamlit.io/deploy
|
| 4 |
+
Advanced settings...
|
| 5 |
+
Python version
|
| 6 |
+
3.7
|
| 7 |
+
3.8
|
| 8 |
+
3.9*
|
| 9 |
+
3.10
|
| 10 |
+
|
| 11 |
+
https://docs.streamlit.io/knowledge-base/using-streamlit/hide-row-indices-displaying-dataframe
|
| 12 |
+
Hide row indices when displaying a dataframe
|
| 13 |
+
# CSS to inject contained in a string
|
| 14 |
+
hide_table_row_index = '''
|
| 15 |
+
<style>
|
| 16 |
+
tbody th {display:none}
|
| 17 |
+
.blank {display:none}
|
| 18 |
+
</style>
|
| 19 |
+
'''
|
| 20 |
+
# Inject CSS with Markdown
|
| 21 |
+
st.markdown(hide_table_row_index, unsafe_allow_html=True)
|
| 22 |
+
|
| 23 |
+
# Display a static table
|
| 24 |
+
st.table(df)
|
| 25 |
+
|
| 26 |
+
# Hide row indices with st.dataframe
|
| 27 |
+
# CSS to inject contained in a string
|
| 28 |
+
hide_dataframe_row_index = '''
|
| 29 |
+
<style>
|
| 30 |
+
.row_heading.level0 {display:none}
|
| 31 |
+
.blank {display:none}
|
| 32 |
+
</style>
|
| 33 |
+
'''
|
| 34 |
+
# Inject CSS with Markdown
|
| 35 |
+
st.markdown(hide_dataframe_row_index, unsafe_allow_html=True)
|
| 36 |
+
|
| 37 |
+
# Display an interactive table
|
| 38 |
+
st.dataframe(df)
|
| 39 |
+
|
| 40 |
+
https://medium.com/@avra42/streamlit-python-cool-tricks-to-make-your-web-application-look-better-8abfc3763a5b
|
| 41 |
+
hide_menu_style = '''
|
| 42 |
+
<style>
|
| 43 |
+
#MainMenu {visibility: hidden; }
|
| 44 |
+
footer {visibility: hidden;}
|
| 45 |
+
</style>
|
| 46 |
+
'''
|
| 47 |
+
st.markdown(hide_menu_style, unsafe_allow_html=True)
|
| 48 |
+
|
| 49 |
+
"""
|
| 50 |
+
# pylint: disable=invalid-name
|
| 51 |
+
import os
|
| 52 |
+
import sys
|
| 53 |
+
import time
|
| 54 |
+
from pathlib import Path
|
| 55 |
+
from types import SimpleNamespace
|
| 56 |
+
from typing import Optional
|
| 57 |
+
|
| 58 |
+
import loguru
|
| 59 |
+
import logzero
|
| 60 |
+
import pandas as pd
|
| 61 |
+
import streamlit as st
|
| 62 |
+
from loguru import logger as loggu
|
| 63 |
+
from logzero import logger
|
| 64 |
+
from set_loglevel import set_loglevel
|
| 65 |
+
from streamlit import session_state as state
|
| 66 |
+
|
| 67 |
+
from litbee import __version__, litbee
|
| 68 |
+
from litbee.options import options
|
| 69 |
+
|
| 70 |
+
# from litbee.files2df import files2df
|
| 71 |
+
# from litbee.utils import sb_front_cover, instructions, menu_items
|
| 72 |
+
# from litbee.ezbee_page import ezbee_page
|
| 73 |
+
# from litbee.dzbee_page import dzbee_page
|
| 74 |
+
# from litbee.xbee_page import xbee_page
|
| 75 |
+
from litbee.utils import menu_items
|
| 76 |
+
|
| 77 |
+
# from ezbee import ezbee
|
| 78 |
+
|
| 79 |
+
curr_py = sys.version[:3]
|
| 80 |
+
msg = f"Some packages litbee depends on can only run with Python 3.8, current python is {curr_py}, sorry..."
|
| 81 |
+
assert curr_py == "3.8", msg
|
| 82 |
+
|
| 83 |
+
os.environ["TZ"] = "Asia/Shanghai"
|
| 84 |
+
time.tzset()
|
| 85 |
+
os.environ["LOGLEVEL"] = "10" # uncomment this in dev
|
| 86 |
+
logzero.loglevel(set_loglevel())
|
| 87 |
+
|
| 88 |
+
loggu.remove()
|
| 89 |
+
_ = (
|
| 90 |
+
"<green>{time:YY-MM-DD HH:mm:ss}</green> | "
|
| 91 |
+
"<level>{level: <5}</level> | <level>{message}</level> "
|
| 92 |
+
"<cyan>{name}</cyan>:<cyan>{line}</cyan>"
|
| 93 |
+
)
|
| 94 |
+
loggu.add(
|
| 95 |
+
sys.stderr,
|
| 96 |
+
format=_,
|
| 97 |
+
level=set_loglevel(),
|
| 98 |
+
colorize=True,
|
| 99 |
+
)
|
| 100 |
+
|
| 101 |
+
# from PIL import Image
|
| 102 |
+
# page_icon=Image.open("icon.ico"),
|
| 103 |
+
st.set_page_config(
|
| 104 |
+
page_title=f"litbee v{__version__}",
|
| 105 |
+
# page_icon="🧊",
|
| 106 |
+
page_icon="🐝",
|
| 107 |
+
# layout="wide",
|
| 108 |
+
initial_sidebar_state="auto", # "auto" or "expanded" or "collapsed",
|
| 109 |
+
menu_items=menu_items,
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
# pd.set_option("precision", 2)
|
| 113 |
+
pd.set_option("display.precision", 2)
|
| 114 |
+
pd.options.display.float_format = "{:,.2f}".format
|
| 115 |
+
|
| 116 |
+
_ = dict(
|
| 117 |
+
beetype="ezbee",
|
| 118 |
+
src_filename="",
|
| 119 |
+
tgt_filename="",
|
| 120 |
+
src_fileio=b"",
|
| 121 |
+
tgt_fileio=b"",
|
| 122 |
+
src_file="",
|
| 123 |
+
tgt_file="",
|
| 124 |
+
list1=[""],
|
| 125 |
+
list2=[""],
|
| 126 |
+
df=None,
|
| 127 |
+
df_a=None,
|
| 128 |
+
df_s_a=None,
|
| 129 |
+
)
|
| 130 |
+
if "ns" not in state:
|
| 131 |
+
state.ns = SimpleNamespace(**_)
|
| 132 |
+
state.ns.list = [*_]
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
def main():
|
| 136 |
+
"""Bootstrap."""
|
| 137 |
+
options()
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
main()
|
app.py
CHANGED
|
@@ -58,14 +58,18 @@ from typing import Optional
|
|
| 58 |
import loguru
|
| 59 |
import logzero
|
| 60 |
import pandas as pd
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
import streamlit as st
|
| 62 |
from loguru import logger as loggu
|
| 63 |
from logzero import logger
|
| 64 |
from set_loglevel import set_loglevel
|
| 65 |
from streamlit import session_state as state
|
| 66 |
|
| 67 |
-
from litbee import __version__
|
| 68 |
-
from litbee.options import options
|
| 69 |
|
| 70 |
# from litbee.files2df import files2df
|
| 71 |
# from litbee.utils import sb_front_cover, instructions, menu_items
|
|
@@ -74,15 +78,28 @@ from litbee.options import options
|
|
| 74 |
# from litbee.xbee_page import xbee_page
|
| 75 |
from litbee.utils import menu_items
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
# from ezbee import ezbee
|
| 78 |
|
| 79 |
curr_py = sys.version[:3]
|
| 80 |
-
msg = f"Some packages litbee depends on can only run with Python 3.8, current python is {curr_py}
|
| 81 |
-
assert
|
| 82 |
|
| 83 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 84 |
time.tzset()
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
| 86 |
logzero.loglevel(set_loglevel())
|
| 87 |
|
| 88 |
loggu.remove()
|
|
@@ -115,6 +132,7 @@ pd.options.display.float_format = "{:,.2f}".format
|
|
| 115 |
|
| 116 |
_ = dict(
|
| 117 |
beetype="ezbee",
|
|
|
|
| 118 |
src_filename="",
|
| 119 |
tgt_filename="",
|
| 120 |
src_fileio=b"",
|
|
@@ -126,15 +144,42 @@ _ = dict(
|
|
| 126 |
df=None,
|
| 127 |
df_a=None,
|
| 128 |
df_s_a=None,
|
|
|
|
| 129 |
)
|
| 130 |
if "ns" not in state:
|
| 131 |
state.ns = SimpleNamespace(**_)
|
| 132 |
state.ns.list = [*_]
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
def main():
|
| 136 |
"""Bootstrap."""
|
| 137 |
-
options()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
|
| 140 |
main()
|
|
|
|
| 58 |
import loguru
|
| 59 |
import logzero
|
| 60 |
import pandas as pd
|
| 61 |
+
import ezbee
|
| 62 |
+
import dzbee
|
| 63 |
+
import debee
|
| 64 |
+
|
| 65 |
import streamlit as st
|
| 66 |
from loguru import logger as loggu
|
| 67 |
from logzero import logger
|
| 68 |
from set_loglevel import set_loglevel
|
| 69 |
from streamlit import session_state as state
|
| 70 |
|
| 71 |
+
from litbee import __version__
|
| 72 |
+
# from litbee.options import options
|
| 73 |
|
| 74 |
# from litbee.files2df import files2df
|
| 75 |
# from litbee.utils import sb_front_cover, instructions, menu_items
|
|
|
|
| 78 |
# from litbee.xbee_page import xbee_page
|
| 79 |
from litbee.utils import menu_items
|
| 80 |
|
| 81 |
+
from litbee.multipage import Multipage
|
| 82 |
+
from litbee.fetch_upload import fetch_upload
|
| 83 |
+
from litbee.settings import settings
|
| 84 |
+
|
| 85 |
+
# from litbee.fetch_paste import fetch_paste
|
| 86 |
+
# from litbee.fetch_urls import fetch_urls
|
| 87 |
+
|
| 88 |
+
from litbee.info import info
|
| 89 |
+
from litbee.utils import style_css
|
| 90 |
+
|
| 91 |
# from ezbee import ezbee
|
| 92 |
|
| 93 |
curr_py = sys.version[:3]
|
| 94 |
+
msg = f"Some packages litbee depends on can only run with Python 3.8, current python is **{curr_py}**, sorry..."
|
| 95 |
+
assert curr_py == "3.8", msg
|
| 96 |
|
| 97 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 98 |
time.tzset()
|
| 99 |
+
|
| 100 |
+
# uncomment this in dev oe set/export LOGLEVEL=10
|
| 101 |
+
# os.environ["LOGLEVEL"] = "10"
|
| 102 |
+
|
| 103 |
logzero.loglevel(set_loglevel())
|
| 104 |
|
| 105 |
loggu.remove()
|
|
|
|
| 132 |
|
| 133 |
_ = dict(
|
| 134 |
beetype="ezbee",
|
| 135 |
+
sourcetype="upload",
|
| 136 |
src_filename="",
|
| 137 |
tgt_filename="",
|
| 138 |
src_fileio=b"",
|
|
|
|
| 144 |
df=None,
|
| 145 |
df_a=None,
|
| 146 |
df_s_a=None,
|
| 147 |
+
count=1,
|
| 148 |
)
|
| 149 |
if "ns" not in state:
|
| 150 |
state.ns = SimpleNamespace(**_)
|
| 151 |
state.ns.list = [*_]
|
| 152 |
|
| 153 |
+
logger.info(
|
| 154 |
+
"versions ezbee dzbee debee: %s, %s, %s",
|
| 155 |
+
ezbee.__version__,
|
| 156 |
+
dzbee.__version__,
|
| 157 |
+
debee.__version__,
|
| 158 |
+
)
|
| 159 |
+
|
| 160 |
|
| 161 |
def main():
|
| 162 |
"""Bootstrap."""
|
| 163 |
+
# options()
|
| 164 |
+
|
| 165 |
+
st.markdown(f"<style>{style_css}</style>", unsafe_allow_html=True)
|
| 166 |
+
|
| 167 |
+
app = Multipage()
|
| 168 |
+
|
| 169 |
+
# app.add_page("Home", "house", ask.app)
|
| 170 |
+
# app.add_page("Settings", "gear", settings.app)
|
| 171 |
+
# app.add_page("Info", "info", info.app)
|
| 172 |
+
|
| 173 |
+
app.add_page("Home", "house", fetch_upload)
|
| 174 |
+
app.add_page("Settings", "gear", settings)
|
| 175 |
+
app.add_page("Info", "info", info)
|
| 176 |
+
|
| 177 |
+
# The main app
|
| 178 |
+
app.run()
|
| 179 |
+
|
| 180 |
+
st.markdown(f"""<div class="text"> run: {state.ns.count}</div>""", unsafe_allow_html=True)
|
| 181 |
+
loggu.debug(f" run: {state.ns.count}")
|
| 182 |
+
state.ns.count += 1
|
| 183 |
|
| 184 |
|
| 185 |
main()
|
app1.py
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Prep __main__.py.
|
| 2 |
+
|
| 3 |
+
https://share.streamlit.io/deploy
|
| 4 |
+
Advanced settings...
|
| 5 |
+
Python version
|
| 6 |
+
3.7
|
| 7 |
+
3.8
|
| 8 |
+
3.9*
|
| 9 |
+
3.10
|
| 10 |
+
|
| 11 |
+
https://docs.streamlit.io/knowledge-base/using-streamlit/hide-row-indices-displaying-dataframe
|
| 12 |
+
Hide row indices when displaying a dataframe
|
| 13 |
+
# CSS to inject contained in a string
|
| 14 |
+
hide_table_row_index = '''
|
| 15 |
+
<style>
|
| 16 |
+
tbody th {display:none}
|
| 17 |
+
.blank {display:none}
|
| 18 |
+
</style>
|
| 19 |
+
'''
|
| 20 |
+
# Inject CSS with Markdown
|
| 21 |
+
st.markdown(hide_table_row_index, unsafe_allow_html=True)
|
| 22 |
+
|
| 23 |
+
# Display a static table
|
| 24 |
+
st.table(df)
|
| 25 |
+
|
| 26 |
+
# Hide row indices with st.dataframe
|
| 27 |
+
# CSS to inject contained in a string
|
| 28 |
+
hide_dataframe_row_index = '''
|
| 29 |
+
<style>
|
| 30 |
+
.row_heading.level0 {display:none}
|
| 31 |
+
.blank {display:none}
|
| 32 |
+
</style>
|
| 33 |
+
'''
|
| 34 |
+
# Inject CSS with Markdown
|
| 35 |
+
st.markdown(hide_dataframe_row_index, unsafe_allow_html=True)
|
| 36 |
+
|
| 37 |
+
# Display an interactive table
|
| 38 |
+
st.dataframe(df)
|
| 39 |
+
|
| 40 |
+
https://medium.com/@avra42/streamlit-python-cool-tricks-to-make-your-web-application-look-better-8abfc3763a5b
|
| 41 |
+
hide_menu_style = '''
|
| 42 |
+
<style>
|
| 43 |
+
#MainMenu {visibility: hidden; }
|
| 44 |
+
footer {visibility: hidden;}
|
| 45 |
+
</style>
|
| 46 |
+
'''
|
| 47 |
+
st.markdown(hide_menu_style, unsafe_allow_html=True)
|
| 48 |
+
|
| 49 |
+
"""
|
| 50 |
+
# pylint: disable=invalid-name
|
| 51 |
+
import os
|
| 52 |
+
import sys
|
| 53 |
+
import time
|
| 54 |
+
from pathlib import Path
|
| 55 |
+
from types import SimpleNamespace
|
| 56 |
+
from typing import Optional
|
| 57 |
+
|
| 58 |
+
import loguru
|
| 59 |
+
import logzero
|
| 60 |
+
import pandas as pd
|
| 61 |
+
import ezbee
|
| 62 |
+
import dzbee
|
| 63 |
+
import debee
|
| 64 |
+
|
| 65 |
+
import streamlit as st
|
| 66 |
+
from loguru import logger as loggu
|
| 67 |
+
from logzero import logger
|
| 68 |
+
from set_loglevel import set_loglevel
|
| 69 |
+
from streamlit import session_state as state
|
| 70 |
+
|
| 71 |
+
from litbee import __version__
|
| 72 |
+
# from litbee.options import options
|
| 73 |
+
|
| 74 |
+
# from litbee.files2df import files2df
|
| 75 |
+
# from litbee.utils import sb_front_cover, instructions, menu_items
|
| 76 |
+
# from litbee.ezbee_page import ezbee_page
|
| 77 |
+
# from litbee.dzbee_page import dzbee_page
|
| 78 |
+
# from litbee.xbee_page import xbee_page
|
| 79 |
+
from litbee.utils import menu_items
|
| 80 |
+
|
| 81 |
+
from litbee.multipage import Multipage
|
| 82 |
+
from litbee.fetch_upload import fetch_upload
|
| 83 |
+
from litbee.settings import settings
|
| 84 |
+
|
| 85 |
+
# from litbee.fetch_paste import fetch_paste
|
| 86 |
+
# from litbee.fetch_urls import fetch_urls
|
| 87 |
+
|
| 88 |
+
from litbee.info import info
|
| 89 |
+
from litbee.utils import style_css
|
| 90 |
+
|
| 91 |
+
# from ezbee import ezbee
|
| 92 |
+
|
| 93 |
+
curr_py = sys.version[:3]
|
| 94 |
+
msg = f"Some packages litbee depends on can only run with Python 3.8, current python is **{curr_py}**, sorry..."
|
| 95 |
+
assert curr_py == "3.8", msg
|
| 96 |
+
|
| 97 |
+
os.environ["TZ"] = "Asia/Shanghai"
|
| 98 |
+
time.tzset()
|
| 99 |
+
|
| 100 |
+
# uncomment this in dev oe set/export LOGLEVEL=10
|
| 101 |
+
# os.environ["LOGLEVEL"] = "10"
|
| 102 |
+
|
| 103 |
+
logzero.loglevel(set_loglevel())
|
| 104 |
+
|
| 105 |
+
loggu.remove()
|
| 106 |
+
_ = (
|
| 107 |
+
"<green>{time:YY-MM-DD HH:mm:ss}</green> | "
|
| 108 |
+
"<level>{level: <5}</level> | <level>{message}</level> "
|
| 109 |
+
"<cyan>{name}</cyan>:<cyan>{line}</cyan>"
|
| 110 |
+
)
|
| 111 |
+
loggu.add(
|
| 112 |
+
sys.stderr,
|
| 113 |
+
format=_,
|
| 114 |
+
level=set_loglevel(),
|
| 115 |
+
colorize=True,
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
# from PIL import Image
|
| 119 |
+
# page_icon=Image.open("icon.ico"),
|
| 120 |
+
st.set_page_config(
|
| 121 |
+
page_title=f"litbee v{__version__}",
|
| 122 |
+
# page_icon="🧊",
|
| 123 |
+
page_icon="🐝",
|
| 124 |
+
# layout="wide",
|
| 125 |
+
initial_sidebar_state="auto", # "auto" or "expanded" or "collapsed",
|
| 126 |
+
menu_items=menu_items,
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
# pd.set_option("precision", 2)
|
| 130 |
+
pd.set_option("display.precision", 2)
|
| 131 |
+
pd.options.display.float_format = "{:,.2f}".format
|
| 132 |
+
|
| 133 |
+
_ = dict(
|
| 134 |
+
beetype="ezbee",
|
| 135 |
+
sourcetype="upload",
|
| 136 |
+
src_filename="",
|
| 137 |
+
tgt_filename="",
|
| 138 |
+
src_fileio=b"",
|
| 139 |
+
tgt_fileio=b"",
|
| 140 |
+
src_file="",
|
| 141 |
+
tgt_file="",
|
| 142 |
+
list1=[""],
|
| 143 |
+
list2=[""],
|
| 144 |
+
df=None,
|
| 145 |
+
df_a=None,
|
| 146 |
+
df_s_a=None,
|
| 147 |
+
count=1,
|
| 148 |
+
)
|
| 149 |
+
if "ns" not in state:
|
| 150 |
+
state.ns = SimpleNamespace(**_)
|
| 151 |
+
state.ns.list = [*_]
|
| 152 |
+
|
| 153 |
+
logger.info(
|
| 154 |
+
"versions ezbee dzbee debee: %s, %s, %s",
|
| 155 |
+
ezbee.__version__,
|
| 156 |
+
dzbee.__version__,
|
| 157 |
+
debee.__version__,
|
| 158 |
+
)
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
def main():
|
| 162 |
+
"""Bootstrap."""
|
| 163 |
+
# options()
|
| 164 |
+
|
| 165 |
+
st.markdown(f"<style>{style_css}</style>", unsafe_allow_html=True)
|
| 166 |
+
|
| 167 |
+
app = Multipage()
|
| 168 |
+
|
| 169 |
+
# app.add_page("Home", "house", ask.app)
|
| 170 |
+
# app.add_page("Settings", "gear", settings.app)
|
| 171 |
+
# app.add_page("Info", "info", info.app)
|
| 172 |
+
|
| 173 |
+
app.add_page("Home", "house", fetch_upload)
|
| 174 |
+
app.add_page("Settings", "gear", settings)
|
| 175 |
+
app.add_page("Info", "info", info)
|
| 176 |
+
|
| 177 |
+
# The main app
|
| 178 |
+
app.run()
|
| 179 |
+
|
| 180 |
+
st.markdown(f"""<div class="text"> run: {state.ns.count}</div>""", unsafe_allow_html=True)
|
| 181 |
+
loggu.debug(f" run: {state.ns.count}")
|
| 182 |
+
state.ns.count += 1
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
main()
|
litbee/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""Init."""
|
| 2 |
-
__version__ = "0.1.
|
| 3 |
from .litbee import litbee
|
| 4 |
|
| 5 |
__all__ = ("litbee",)
|
|
|
|
| 1 |
"""Init."""
|
| 2 |
+
__version__ = "0.1.2a0"
|
| 3 |
from .litbee import litbee
|
| 4 |
|
| 5 |
__all__ = ("litbee",)
|
litbee/app.py
CHANGED
|
@@ -78,7 +78,7 @@ from litbee.utils import menu_items
|
|
| 78 |
|
| 79 |
curr_py = sys.version[:3]
|
| 80 |
msg = f"Some packages litbee depends on can only run with Python 3.8, current python is {curr_py}, sorry..."
|
| 81 |
-
assert
|
| 82 |
|
| 83 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 84 |
time.tzset()
|
|
|
|
| 78 |
|
| 79 |
curr_py = sys.version[:3]
|
| 80 |
msg = f"Some packages litbee depends on can only run with Python 3.8, current python is {curr_py}, sorry..."
|
| 81 |
+
assert curr_py == "3.8", msg
|
| 82 |
|
| 83 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 84 |
time.tzset()
|
litbee/fetch_upload.py
CHANGED
|
@@ -2,16 +2,19 @@
|
|
| 2 |
|
| 3 |
org ezbee_page.py.
|
| 4 |
"""
|
|
|
|
| 5 |
from functools import partial
|
|
|
|
| 6 |
from itertools import zip_longest
|
|
|
|
| 7 |
|
| 8 |
import logzero
|
| 9 |
import numpy as np
|
| 10 |
import pandas as pd
|
| 11 |
import streamlit as st
|
| 12 |
-
from dzbee import dzbee
|
| 13 |
-
from ezbee import ezbee
|
| 14 |
-
from debee import debee
|
| 15 |
|
| 16 |
# from ezbee.gen_pairs import gen_pairs # aset2pairs?
|
| 17 |
from aset2pairs import aset2pairs
|
|
@@ -19,21 +22,29 @@ from fastlid import fastlid
|
|
| 19 |
from icecream import ic
|
| 20 |
from loguru import logger as loggu
|
| 21 |
from logzero import logger
|
| 22 |
-
from set_loglevel import set_loglevel
|
| 23 |
from st_aggrid import AgGrid, GridUpdateMode, GridOptionsBuilder
|
| 24 |
# from st_aggrid.grid_options_builder import GridOptionsBuilder
|
| 25 |
from streamlit import session_state as state
|
| 26 |
|
| 27 |
-
logzero.loglevel(set_loglevel())
|
| 28 |
|
| 29 |
|
| 30 |
-
def fetch_upload():
|
| 31 |
"""Fetch content from upload."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# src_fileio tgt_fileio
|
| 34 |
with st.form(key='upload_in_form'):
|
| 35 |
-
|
| 36 |
-
with
|
| 37 |
col1, col2 = st.columns(2)
|
| 38 |
with col1:
|
| 39 |
src_fileio = st.file_uploader(
|
|
@@ -57,12 +68,10 @@ def fetch_upload():
|
|
| 57 |
)
|
| 58 |
submitted = st.form_submit_button('Submit')
|
| 59 |
|
| 60 |
-
if not submitted:
|
| 61 |
-
return None
|
| 62 |
-
|
| 63 |
# logger.debug(" len(src_fileio): %s", len(src_fileio))
|
| 64 |
# logger.debug(" len(tgt_fileio): %s", len(tgt_fileio))
|
| 65 |
|
|
|
|
| 66 |
if src_fileio:
|
| 67 |
logger.debug(" type(src_fileio): %s", type(src_fileio))
|
| 68 |
|
|
@@ -87,7 +96,9 @@ def fetch_upload():
|
|
| 87 |
# state.ns.src_fileio = src_fileio
|
| 88 |
state.ns.src_file = src_fileio.getvalue().decode()
|
| 89 |
state.ns.src_filename = src_fileio.name
|
|
|
|
| 90 |
|
|
|
|
| 91 |
if tgt_fileio:
|
| 92 |
if isinstance(tgt_fileio, list):
|
| 93 |
logger.warning("not set to handle multiple files")
|
|
@@ -95,6 +106,32 @@ def fetch_upload():
|
|
| 95 |
else:
|
| 96 |
state.ns.tgt_file = tgt_fileio.getvalue().decode()
|
| 97 |
state.ns.tgt_filename = tgt_fileio.name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
try:
|
| 100 |
_ = state.ns.src_file.splitlines()
|
|
@@ -173,33 +210,45 @@ def fetch_upload():
|
|
| 173 |
fastlid.set_languages = None
|
| 174 |
|
| 175 |
fn = globals()[state.ns.beetype]
|
| 176 |
-
logger.debug("type(fn): %s", fn)
|
| 177 |
-
logger.debug("dir(fn): %s", dir(fn))
|
| 178 |
-
logger.debug("fn.__doc__: %s", fn.__doc__)
|
| 179 |
logger.debug("fn.__name__: %s", fn.__name__)
|
| 180 |
-
|
| 181 |
from inspect import getabsfile
|
| 182 |
logger.debug("getabsfile(fn): %s", getabsfile(fn))
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
try:
|
| 185 |
-
|
| 186 |
-
aset = globals()[state.ns.beetype](
|
| 187 |
-
list1,
|
| 188 |
-
list2,
|
| 189 |
-
# eps=eps,
|
| 190 |
-
# min_samples=min_samples,
|
| 191 |
-
)
|
| 192 |
except Exception as e:
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
lineno = inspect.currentframe().f_lineno
|
| 202 |
-
st.write(f"{state.ns.beetype} coming soon...{filenmae}:{lineno}")
|
| 203 |
return None
|
| 204 |
|
| 205 |
# fastlid changed logger.level to 20
|
|
@@ -214,12 +263,15 @@ def fetch_upload():
|
|
| 214 |
# aligned_pairs = gen_pairs(list1, list2, aset)
|
| 215 |
aligned_pairs = aset2pairs(list1, list2, aset)
|
| 216 |
if aligned_pairs:
|
| 217 |
-
logger.debug("%s...%s", aligned_pairs[:
|
| 218 |
# logger.debug("aligned_pairs[:20]: \n%s", aligned_pairs[:20])
|
| 219 |
|
| 220 |
df_a = pd.DataFrame(aligned_pairs, columns=["text1", "text2", "llh"], dtype="object")
|
| 221 |
|
| 222 |
-
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
# insert seq no
|
| 225 |
df_a.insert(0, "sn", range(len(df_a)))
|
|
@@ -235,16 +287,18 @@ def fetch_upload():
|
|
| 235 |
gb.configure_default_column(**options)
|
| 236 |
gridOptions = gb.build()
|
| 237 |
|
| 238 |
-
st.write("aligned (double-click a cell to edit, drag column header to adjust widths)")
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
org ezbee_page.py.
|
| 4 |
"""
|
| 5 |
+
# pylint: disable=invalid-name
|
| 6 |
from functools import partial
|
| 7 |
+
import inspect
|
| 8 |
from itertools import zip_longest
|
| 9 |
+
from time import perf_counter
|
| 10 |
|
| 11 |
import logzero
|
| 12 |
import numpy as np
|
| 13 |
import pandas as pd
|
| 14 |
import streamlit as st
|
| 15 |
+
from dzbee import dzbee # noqa
|
| 16 |
+
from ezbee import ezbee # noqa
|
| 17 |
+
from debee import debee # noqa
|
| 18 |
|
| 19 |
# from ezbee.gen_pairs import gen_pairs # aset2pairs?
|
| 20 |
from aset2pairs import aset2pairs
|
|
|
|
| 22 |
from icecream import ic
|
| 23 |
from loguru import logger as loggu
|
| 24 |
from logzero import logger
|
|
|
|
| 25 |
from st_aggrid import AgGrid, GridUpdateMode, GridOptionsBuilder
|
| 26 |
# from st_aggrid.grid_options_builder import GridOptionsBuilder
|
| 27 |
from streamlit import session_state as state
|
| 28 |
|
| 29 |
+
# logzero.loglevel(set_loglevel())
|
| 30 |
|
| 31 |
|
| 32 |
+
def fetch_upload(): # noqa
|
| 33 |
"""Fetch content from upload."""
|
| 34 |
+
# st.write(state.ns.beetype)
|
| 35 |
+
|
| 36 |
+
if state.ns.sourcetype not in ["upload"]:
|
| 37 |
+
st.write("Coming soooooooon...")
|
| 38 |
+
return None
|
| 39 |
+
|
| 40 |
+
if state.ns.beetype not in ["ezbee", "dzbee", "debee"]:
|
| 41 |
+
st.write("Coming soon...")
|
| 42 |
+
return None
|
| 43 |
|
| 44 |
# src_fileio tgt_fileio
|
| 45 |
with st.form(key='upload_in_form'):
|
| 46 |
+
_ = st.expander(f"{state.ns.beetype}: Pick two files", expanded=True)
|
| 47 |
+
with _:
|
| 48 |
col1, col2 = st.columns(2)
|
| 49 |
with col1:
|
| 50 |
src_fileio = st.file_uploader(
|
|
|
|
| 68 |
)
|
| 69 |
submitted = st.form_submit_button('Submit')
|
| 70 |
|
|
|
|
|
|
|
|
|
|
| 71 |
# logger.debug(" len(src_fileio): %s", len(src_fileio))
|
| 72 |
# logger.debug(" len(tgt_fileio): %s", len(tgt_fileio))
|
| 73 |
|
| 74 |
+
filename1 = ""
|
| 75 |
if src_fileio:
|
| 76 |
logger.debug(" type(src_fileio): %s", type(src_fileio))
|
| 77 |
|
|
|
|
| 96 |
# state.ns.src_fileio = src_fileio
|
| 97 |
state.ns.src_file = src_fileio.getvalue().decode()
|
| 98 |
state.ns.src_filename = src_fileio.name
|
| 99 |
+
filename1 = state.ns.src_filename
|
| 100 |
|
| 101 |
+
filename2 = ""
|
| 102 |
if tgt_fileio:
|
| 103 |
if isinstance(tgt_fileio, list):
|
| 104 |
logger.warning("not set to handle multiple files")
|
|
|
|
| 106 |
else:
|
| 107 |
state.ns.tgt_file = tgt_fileio.getvalue().decode()
|
| 108 |
state.ns.tgt_filename = tgt_fileio.name
|
| 109 |
+
filename2 = tgt_fileio.name
|
| 110 |
+
|
| 111 |
+
# proceed when Submit is clicked
|
| 112 |
+
msg1 = ""
|
| 113 |
+
if filename1:
|
| 114 |
+
msg1 += f" file1: {filename1}"
|
| 115 |
+
msg2 = ""
|
| 116 |
+
if filename2:
|
| 117 |
+
msg2 += f" file2: {filename2}"
|
| 118 |
+
glue = ""
|
| 119 |
+
if filename1 and filename2:
|
| 120 |
+
glue = ", "
|
| 121 |
+
|
| 122 |
+
st.write(f" Submitted upload: {msg1}{glue}{msg2}")
|
| 123 |
+
if not submitted:
|
| 124 |
+
return None
|
| 125 |
+
|
| 126 |
+
if not (filename1 or filename2):
|
| 127 |
+
st.write("| no file uploaded")
|
| 128 |
+
return None
|
| 129 |
+
elif not filename1:
|
| 130 |
+
st.write("| file1 not ready")
|
| 131 |
+
return None
|
| 132 |
+
elif not filename2:
|
| 133 |
+
st.write("| file2 not ready")
|
| 134 |
+
return None
|
| 135 |
|
| 136 |
try:
|
| 137 |
_ = state.ns.src_file.splitlines()
|
|
|
|
| 210 |
fastlid.set_languages = None
|
| 211 |
|
| 212 |
fn = globals()[state.ns.beetype]
|
| 213 |
+
# logger.debug("type(fn): %s", fn)
|
| 214 |
+
# logger.debug("dir(fn): %s", dir(fn))
|
| 215 |
+
# logger.debug("fn.__doc__: %s", fn.__doc__)
|
| 216 |
logger.debug("fn.__name__: %s", fn.__name__)
|
| 217 |
+
|
| 218 |
from inspect import getabsfile
|
| 219 |
logger.debug("getabsfile(fn): %s", getabsfile(fn))
|
| 220 |
|
| 221 |
+
with st.spinner(" diggin..."):
|
| 222 |
+
then = perf_counter()
|
| 223 |
+
try:
|
| 224 |
+
# aset = ezbee/dzbee/debee
|
| 225 |
+
aset = globals()[state.ns.beetype](
|
| 226 |
+
list1,
|
| 227 |
+
list2,
|
| 228 |
+
# eps=eps,
|
| 229 |
+
# min_samples=min_samples,
|
| 230 |
+
)
|
| 231 |
+
except Exception as e:
|
| 232 |
+
# logger.error("aset = ezbee(...) exc: %s", e)
|
| 233 |
+
logger.exception("aset = globals()[state.ns.beetype](...) exc: %s", e)
|
| 234 |
+
aset = ""
|
| 235 |
+
# st.write(e)
|
| 236 |
+
st.write("Collecting inputs...")
|
| 237 |
+
return None
|
| 238 |
+
st.success(f"Done, took {perf_counter() - then:.2f} s")
|
| 239 |
+
|
| 240 |
+
else:
|
| 241 |
try:
|
| 242 |
+
filename = inspect.currentframe().f_code.co_filename
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
except Exception as e:
|
| 244 |
+
logger.error(e)
|
| 245 |
+
filename = ""
|
| 246 |
+
try:
|
| 247 |
+
lineno = inspect.currentframe().f_lineno
|
| 248 |
+
except Exception as e:
|
| 249 |
+
logger.error(e)
|
| 250 |
+
lineno = ""
|
| 251 |
+
st.write(f"{state.ns.beetype} coming soon...{filename}:{lineno}")
|
|
|
|
|
|
|
| 252 |
return None
|
| 253 |
|
| 254 |
# fastlid changed logger.level to 20
|
|
|
|
| 263 |
# aligned_pairs = gen_pairs(list1, list2, aset)
|
| 264 |
aligned_pairs = aset2pairs(list1, list2, aset)
|
| 265 |
if aligned_pairs:
|
| 266 |
+
logger.debug("%s...%s", aligned_pairs[:1], aligned_pairs[-1:])
|
| 267 |
# logger.debug("aligned_pairs[:20]: \n%s", aligned_pairs[:20])
|
| 268 |
|
| 269 |
df_a = pd.DataFrame(aligned_pairs, columns=["text1", "text2", "llh"], dtype="object")
|
| 270 |
|
| 271 |
+
# if set_loglevel() <= 10:
|
| 272 |
+
_ = st.expander("done aligned")
|
| 273 |
+
with _:
|
| 274 |
+
st.table(df_a.astype(str))
|
| 275 |
|
| 276 |
# insert seq no
|
| 277 |
df_a.insert(0, "sn", range(len(df_a)))
|
|
|
|
| 287 |
gb.configure_default_column(**options)
|
| 288 |
gridOptions = gb.build()
|
| 289 |
|
| 290 |
+
# st.write("editable aligned (double-click a cell to edit, drag column header to adjust widths)")
|
| 291 |
+
_ = "editable aligned (double-click a cell to edit, drag column header to adjust widths)"
|
| 292 |
+
with st.expander(_, expanded=False):
|
| 293 |
+
ag_df = AgGrid(
|
| 294 |
+
# df,
|
| 295 |
+
df_a,
|
| 296 |
+
gridOptions=gridOptions,
|
| 297 |
+
key="outside",
|
| 298 |
+
reload_data=True,
|
| 299 |
+
editable=True,
|
| 300 |
+
# width="100%", # width parameter is deprecated
|
| 301 |
+
height=750,
|
| 302 |
+
# fit_columns_on_grid_load=True,
|
| 303 |
+
update_mode=GridUpdateMode.MODEL_CHANGED
|
| 304 |
+
)
|
litbee/info.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Present info about litbee."""
|
| 2 |
+
import ezbee
|
| 3 |
+
import dzbee
|
| 4 |
+
import debee
|
| 5 |
+
|
| 6 |
+
from textwrap import dedent
|
| 7 |
+
import streamlit as st
|
| 8 |
+
from litbee import __version__
|
| 9 |
+
|
| 10 |
+
# from litbee.utils import style_css
|
| 11 |
+
|
| 12 |
+
msg = dedent(
|
| 13 |
+
f"""
|
| 14 |
+
(ezbee {ezbee.__version__}, dzbee {dzbee.__version__}, debee {debee.__version__})
|
| 15 |
+
<div class="text">
|
| 16 |
+
<ul>
|
| 17 |
+
<li> ezbee: english-chinese, fast para-align
|
| 18 |
+
|
| 19 |
+
<li> dzbee: german-chinese, fast para-align
|
| 20 |
+
|
| 21 |
+
<li> debee: german-english, fast para-align
|
| 22 |
+
|
| 23 |
+
<li> xbee/bumblebee: other language pairs, normal para-align
|
| 24 |
+
</ul>
|
| 25 |
+
|
| 26 |
+
The algorithm for fast para-align is home-brewn. Two sent-align algorithms are used: one based on Gale-Church, the other machine learning.
|
| 27 |
+
</div>
|
| 28 |
+
"""
|
| 29 |
+
).strip()
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def info():
|
| 33 |
+
"""Prep info page."""
|
| 34 |
+
_ = """
|
| 35 |
+
st.markdown(f"### litbee {__version__} ")
|
| 36 |
+
|
| 37 |
+
# sb_tit_expander = st.sidebar.expander("More info (click to toggle)", expanded=False)
|
| 38 |
+
# _ = st.expander("More info (click to toggle)", expanded=False)
|
| 39 |
+
_ = st.expander("Click to toggle", expanded=True)
|
| 40 |
+
with _:
|
| 41 |
+
st.markdown(msg)
|
| 42 |
+
# """
|
| 43 |
+
|
| 44 |
+
# st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
|
| 45 |
+
# st.markdown(f"<style>{style_css}</style>", unsafe_allow_html=True)
|
| 46 |
+
|
| 47 |
+
# st.subheader("Intro")
|
| 48 |
+
|
| 49 |
+
st.subheader(f"litbee {__version__}")
|
| 50 |
+
|
| 51 |
+
st.markdown(msg, unsafe_allow_html=True)
|
litbee/multipage.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Credit to https://huggingface.co/spaces/lfqa/lfqa.
|
| 2 |
+
|
| 3 |
+
This file is the framework for generating multiple Streamlit applications
|
| 4 |
+
through an object oriented framework.
|
| 5 |
+
"""
|
| 6 |
+
# Import necessary libraries
|
| 7 |
+
import streamlit as st
|
| 8 |
+
from streamlit_option_menu import option_menu
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
# Define the multipage class to manage the multiple apps in our program
|
| 12 |
+
class Multipage:
|
| 13 |
+
"""Framework for combining multiple streamlit applications."""
|
| 14 |
+
|
| 15 |
+
def __init__(self) -> None:
|
| 16 |
+
"""Constructor class to generate a list which will store all our applications as an instance variable."""
|
| 17 |
+
self.pages = []
|
| 18 |
+
|
| 19 |
+
def add_page(self, title, icon, func) -> None:
|
| 20 |
+
"""Class Method to Add pages to the project
|
| 21 |
+
|
| 22 |
+
Args:
|
| 23 |
+
title ([str]): The title of page which we are adding to the list of apps
|
| 24 |
+
|
| 25 |
+
func: Python function to render this page in Streamlit
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
self.pages.append(
|
| 29 |
+
{
|
| 30 |
+
"title": title,
|
| 31 |
+
"icon": icon,
|
| 32 |
+
"function": func
|
| 33 |
+
}
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
def run(self):
|
| 37 |
+
# Drodown to select the page to run
|
| 38 |
+
st.markdown("""
|
| 39 |
+
<style>
|
| 40 |
+
section[data-testid="stSidebar"] > div:first-of-type {
|
| 41 |
+
background-color: var(--secondary-background-color);
|
| 42 |
+
background: var(--secondary-background-color);
|
| 43 |
+
width: 250px;
|
| 44 |
+
padding: 4rem 0;
|
| 45 |
+
box-shadow: -2rem 0px 2rem 2rem rgba(0,0,0,0.16);
|
| 46 |
+
}
|
| 47 |
+
section[aria-expanded="true"] > div:nth-of-type(2) {
|
| 48 |
+
display: none;
|
| 49 |
+
}
|
| 50 |
+
.main > div:first-of-type {
|
| 51 |
+
padding: 1rem 0;
|
| 52 |
+
}
|
| 53 |
+
</style>
|
| 54 |
+
""", unsafe_allow_html=True)
|
| 55 |
+
|
| 56 |
+
with st.sidebar:
|
| 57 |
+
selected = option_menu(None, [page["title"] for page in self.pages],
|
| 58 |
+
icons=[page["icon"] for page in self.pages],
|
| 59 |
+
menu_icon="cast", default_index=0)
|
| 60 |
+
|
| 61 |
+
# Run the selected page
|
| 62 |
+
for index, item in enumerate(self.pages):
|
| 63 |
+
if item["title"] == selected:
|
| 64 |
+
self.pages[index]["function"]()
|
| 65 |
+
break
|
litbee/options.py
CHANGED
|
@@ -7,13 +7,12 @@ from loguru import logger as loggu
|
|
| 7 |
from logzero import logger
|
| 8 |
from streamlit import session_state as state
|
| 9 |
|
| 10 |
-
from litbee.fetch_paste import fetch_paste
|
| 11 |
-
|
| 12 |
# from litbee.ezbee_page import ezbee_page
|
| 13 |
# from litbee.dzbee_page import dzbee_page
|
| 14 |
# from litbee.xbee_page import xbee_page
|
| 15 |
from litbee.fetch_upload import fetch_upload
|
| 16 |
from litbee.fetch_urls import fetch_urls
|
|
|
|
| 17 |
from litbee.files2df import files2df
|
| 18 |
from litbee.utils import instructions, sb_front_cover
|
| 19 |
|
|
|
|
| 7 |
from logzero import logger
|
| 8 |
from streamlit import session_state as state
|
| 9 |
|
|
|
|
|
|
|
| 10 |
# from litbee.ezbee_page import ezbee_page
|
| 11 |
# from litbee.dzbee_page import dzbee_page
|
| 12 |
# from litbee.xbee_page import xbee_page
|
| 13 |
from litbee.fetch_upload import fetch_upload
|
| 14 |
from litbee.fetch_urls import fetch_urls
|
| 15 |
+
from litbee.fetch_paste import fetch_paste
|
| 16 |
from litbee.files2df import files2df
|
| 17 |
from litbee.utils import instructions, sb_front_cover
|
| 18 |
|
litbee/settings.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Prep Settings/Options page."""
|
| 2 |
+
# pylint: disable=invalid-name
|
| 3 |
+
from functools import partial
|
| 4 |
+
import streamlit as st
|
| 5 |
+
from loguru import logger as loggu
|
| 6 |
+
from logzero import logger
|
| 7 |
+
from streamlit import session_state as state
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def settings():
|
| 11 |
+
"""Prep Settings/Options page.
|
| 12 |
+
|
| 13 |
+
Refer to options.py"""
|
| 14 |
+
# horizotal radio
|
| 15 |
+
st.write(
|
| 16 |
+
"<style>div.row-widget.stRadio > div{flex-direction:row;}</style>",
|
| 17 |
+
unsafe_allow_html=True,
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
sourcetype_list = ["upload", "paste", "urls"]
|
| 21 |
+
beetype_list = ["ezbee", "dzbee", "debee", "xbee"]
|
| 22 |
+
|
| 23 |
+
# col1, col2 = st.columns([24, 21]) # 4*6, 3*7
|
| 24 |
+
col1, col2 = st.columns(2)
|
| 25 |
+
|
| 26 |
+
with col1:
|
| 27 |
+
try:
|
| 28 |
+
index = beetype_list.index(state.ns.beetype)
|
| 29 |
+
except Exception as e:
|
| 30 |
+
logger.error("beetype index error: %s, setting to 0", e)
|
| 31 |
+
index = 0
|
| 32 |
+
beetype = st.radio(
|
| 33 |
+
"Pick a bee",
|
| 34 |
+
beetype_list,
|
| 35 |
+
index=index,
|
| 36 |
+
format_func=lambda x: f"{x:<7}|",
|
| 37 |
+
)
|
| 38 |
+
state.ns.beetype = beetype
|
| 39 |
+
with col2:
|
| 40 |
+
try:
|
| 41 |
+
index = sourcetype_list.index(state.ns.sourcetype)
|
| 42 |
+
except Exception as e:
|
| 43 |
+
logger.error("sourcetype index error: %s, setting to 0", e)
|
| 44 |
+
index = 0
|
| 45 |
+
sourcetype = st.radio(
|
| 46 |
+
"Source",
|
| 47 |
+
sourcetype_list,
|
| 48 |
+
index=index,
|
| 49 |
+
format_func=lambda x: f"{x:<8}|"
|
| 50 |
+
)
|
| 51 |
+
state.ns.sourcetype = sourcetype
|
| 52 |
+
|
| 53 |
+
# show state.ns[:6]
|
| 54 |
+
loggu.debug(f" state.ns.list: {state.ns.list}")
|
| 55 |
+
|
| 56 |
+
# beetype, sourcetype, filename1, filename2
|
| 57 |
+
_ = map(partial(getattr, state.ns), state.ns.list[:4])
|
| 58 |
+
logger.debug(" state.ns.list[:3]: %s", str([*_]))
|
| 59 |
+
|
| 60 |
+
# st.write(f"run: {state.ns.count}")
|
| 61 |
+
# loggu.debug(f"run: {state.ns.count}")
|
litbee/utils.py
CHANGED
|
@@ -86,3 +86,183 @@ menu_items = {
|
|
| 86 |
"Report a bug": "https://github.com/ffreemt/litbee/issues",
|
| 87 |
"About": about_msg,
|
| 88 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
"Report a bug": "https://github.com/ffreemt/litbee/issues",
|
| 87 |
"About": about_msg,
|
| 88 |
}
|
| 89 |
+
|
| 90 |
+
style_css = """
|
| 91 |
+
.row-widget.stTextInput > div:first-of-type {
|
| 92 |
+
background: #fff;
|
| 93 |
+
display: flex;
|
| 94 |
+
border: 1px solid #dfe1e5;
|
| 95 |
+
box-shadow: none;
|
| 96 |
+
border-radius: 24px;
|
| 97 |
+
height: 50px;
|
| 98 |
+
width: auto;
|
| 99 |
+
margin: 10px auto 30px;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.row-widget.stTextInput > div:first-of-type:hover,
|
| 103 |
+
.row-widget.stTextInput > div:first-of-type:focus {
|
| 104 |
+
box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.2);
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.row-widget.stTextInput .st-bq {
|
| 108 |
+
background-color: #fff;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
.row-widget.stTextInput > label {
|
| 112 |
+
color: #b3b3b3;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.row-widget.stButton > button {
|
| 116 |
+
border-radius: 24px;
|
| 117 |
+
background-color: #B6C9B1;
|
| 118 |
+
color: #fff;
|
| 119 |
+
border: none;
|
| 120 |
+
padding: 6px 20px;
|
| 121 |
+
float: right;
|
| 122 |
+
background-image: none;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
.row-widget.stButton > button:hover {
|
| 126 |
+
box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.2);
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
.row-widget.stButton > button:focus {
|
| 130 |
+
border: none;
|
| 131 |
+
color: #fff;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
.footer-custom {
|
| 135 |
+
position: fixed;
|
| 136 |
+
bottom: 0;
|
| 137 |
+
width: 100%;
|
| 138 |
+
color: var(--text-color);
|
| 139 |
+
max-width: 698px;
|
| 140 |
+
font-size: 14px;
|
| 141 |
+
height: 50px;
|
| 142 |
+
padding: 10px 0;
|
| 143 |
+
z-index: 50;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.main {
|
| 147 |
+
padding: 20px;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
footer {
|
| 151 |
+
display: none !important;
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
.footer-custom a {
|
| 155 |
+
color: var(--text-color);
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
#wikipedia-assistant {
|
| 159 |
+
font-size: 36px;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
.generated-answer p {
|
| 163 |
+
font-size: 16px;
|
| 164 |
+
font-weight: bold;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
.react-json-view {
|
| 168 |
+
margin: 40px 0 80px;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.tooltip {
|
| 172 |
+
text-align: center;
|
| 173 |
+
line-height: 20px;
|
| 174 |
+
display: table-caption;
|
| 175 |
+
font-size: 10px;
|
| 176 |
+
border-radius: 50%;
|
| 177 |
+
height: 20px;
|
| 178 |
+
width: 20px;
|
| 179 |
+
position: relative;
|
| 180 |
+
cursor: pointer;
|
| 181 |
+
color:#000;
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
.tooltip .tooltiptext {
|
| 185 |
+
visibility: hidden;
|
| 186 |
+
width: 280px;
|
| 187 |
+
text-align: center;
|
| 188 |
+
border-radius: 6px;
|
| 189 |
+
padding: 10px;
|
| 190 |
+
position: absolute;
|
| 191 |
+
z-index: 1;
|
| 192 |
+
top: 25px;
|
| 193 |
+
left: 50%;
|
| 194 |
+
margin-left: -140px;
|
| 195 |
+
font-size: 14px;
|
| 196 |
+
background-color: #fff;
|
| 197 |
+
border: 1px solid #ccc;
|
| 198 |
+
box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.16);
|
| 199 |
+
color: #000;
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
.tooltip:hover .tooltiptext {
|
| 203 |
+
visibility: visible;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
.sentence-wrapper {
|
| 207 |
+
border-left: 4px solid #ffc423;
|
| 208 |
+
padding-left: 20px;
|
| 209 |
+
margin-bottom: 40px;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
#context {
|
| 213 |
+
padding: 2rem 0 1rem;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
hr {
|
| 217 |
+
margin: 2em 0 1em;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.technical-details-info {
|
| 221 |
+
margin-bottom: 100px;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
.loader-wrapper {
|
| 225 |
+
display: flex;
|
| 226 |
+
align-items: center;
|
| 227 |
+
background-color: rgba(250, 202, 43, 0.2);
|
| 228 |
+
padding: 15px 20px;
|
| 229 |
+
border-radius: 6px;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
.loader-wrapper p {
|
| 233 |
+
margin-bottom: 0;
|
| 234 |
+
margin-left: 20px;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
.loader {
|
| 238 |
+
width: 30px;
|
| 239 |
+
height: 30px;
|
| 240 |
+
border: dotted 5px #868686;
|
| 241 |
+
border-radius: 100%;
|
| 242 |
+
animation: spin 1s linear infinite;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.loader-note {
|
| 246 |
+
font-size: 14px;
|
| 247 |
+
color: #b3b3b3;
|
| 248 |
+
margin-left: 5px;
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
@keyframes spin {
|
| 252 |
+
0% {
|
| 253 |
+
transform: rotate(0deg) scale(0.8);
|
| 254 |
+
border-top-color: transparent;
|
| 255 |
+
border-right-color: transparent;
|
| 256 |
+
}
|
| 257 |
+
50% { transform: rotate(180deg) scale(1.2);
|
| 258 |
+
border-color: #949494;
|
| 259 |
+
border-top-color: transparent;
|
| 260 |
+
border-right-color: transparent;
|
| 261 |
+
}
|
| 262 |
+
100% { transform: rotate(360deg) scale(0.8);
|
| 263 |
+
border-color: #bbbbbb;
|
| 264 |
+
border-top-color: transparent;
|
| 265 |
+
border-right-color: transparent;
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
"""
|
poetry.lock
CHANGED
|
@@ -1678,6 +1678,17 @@ category = "main"
|
|
| 1678 |
optional = false
|
| 1679 |
python-versions = ">=3.6"
|
| 1680 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1681 |
[[package]]
|
| 1682 |
name = "terminado"
|
| 1683 |
version = "0.15.0"
|
|
@@ -1956,7 +1967,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
|
|
| 1956 |
[metadata]
|
| 1957 |
lock-version = "1.1"
|
| 1958 |
python-versions = "^3.8.3"
|
| 1959 |
-
content-hash = "
|
| 1960 |
|
| 1961 |
[metadata.files]
|
| 1962 |
about-time = [
|
|
@@ -3092,6 +3103,10 @@ streamlit-multipage = [
|
|
| 3092 |
{file = "streamlit-multipage-0.0.18.tar.gz", hash = "sha256:698bc4af147c9d76a17ba0df286547c8e167255df08eb50e353349b606e74a11"},
|
| 3093 |
{file = "streamlit_multipage-0.0.18-py3-none-any.whl", hash = "sha256:a9a4da06c29ef312878b7ea968cc4f130a0f37c2f738b259a52885bddf18b78c"},
|
| 3094 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3095 |
terminado = [
|
| 3096 |
{file = "terminado-0.15.0-py3-none-any.whl", hash = "sha256:0d5f126fbfdb5887b25ae7d9d07b0d716b1cc0ccaacc71c1f3c14d228e065197"},
|
| 3097 |
{file = "terminado-0.15.0.tar.gz", hash = "sha256:ab4eeedccfcc1e6134bfee86106af90852c69d602884ea3a1e8ca6d4486e9bfe"},
|
|
|
|
| 1678 |
optional = false
|
| 1679 |
python-versions = ">=3.6"
|
| 1680 |
|
| 1681 |
+
[[package]]
|
| 1682 |
+
name = "streamlit-option-menu"
|
| 1683 |
+
version = "0.3.2"
|
| 1684 |
+
description = "streamlit-option-menu is a simple Streamlit component that allows users to select a single item from a list of options in a menu."
|
| 1685 |
+
category = "main"
|
| 1686 |
+
optional = false
|
| 1687 |
+
python-versions = ">=3.6"
|
| 1688 |
+
|
| 1689 |
+
[package.dependencies]
|
| 1690 |
+
streamlit = ">=0.63"
|
| 1691 |
+
|
| 1692 |
[[package]]
|
| 1693 |
name = "terminado"
|
| 1694 |
version = "0.15.0"
|
|
|
|
| 1967 |
[metadata]
|
| 1968 |
lock-version = "1.1"
|
| 1969 |
python-versions = "^3.8.3"
|
| 1970 |
+
content-hash = "0001273edc2530f75a45f1baa8b689876cba18a12373a5f50776c6d758fbaee2"
|
| 1971 |
|
| 1972 |
[metadata.files]
|
| 1973 |
about-time = [
|
|
|
|
| 3103 |
{file = "streamlit-multipage-0.0.18.tar.gz", hash = "sha256:698bc4af147c9d76a17ba0df286547c8e167255df08eb50e353349b606e74a11"},
|
| 3104 |
{file = "streamlit_multipage-0.0.18-py3-none-any.whl", hash = "sha256:a9a4da06c29ef312878b7ea968cc4f130a0f37c2f738b259a52885bddf18b78c"},
|
| 3105 |
]
|
| 3106 |
+
streamlit-option-menu = [
|
| 3107 |
+
{file = "streamlit-option-menu-0.3.2.tar.gz", hash = "sha256:69d1aef6f30f83f29eda3dc9667733bc2e28cd640eb17b4b6ca315f633484c52"},
|
| 3108 |
+
{file = "streamlit_option_menu-0.3.2-py3-none-any.whl", hash = "sha256:0b7eae3ffdb0276c81d15750465c72957d57d2f766cb027c586d053519731178"},
|
| 3109 |
+
]
|
| 3110 |
terminado = [
|
| 3111 |
{file = "terminado-0.15.0-py3-none-any.whl", hash = "sha256:0d5f126fbfdb5887b25ae7d9d07b0d716b1cc0ccaacc71c1f3c14d228e065197"},
|
| 3112 |
{file = "terminado-0.15.0.tar.gz", hash = "sha256:ab4eeedccfcc1e6134bfee86106af90852c69d602884ea3a1e8ca6d4486e9bfe"},
|
pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "litbee"
|
| 3 |
-
version = "0.1.
|
| 4 |
description = "align (en, de, zh) texts via streamlit "
|
| 5 |
authors = ["ffreemt"]
|
| 6 |
license = "MIT"
|
|
@@ -21,6 +21,7 @@ loguru = "^0.6.0"
|
|
| 21 |
streamlit = "^1.9.2"
|
| 22 |
debee = "^0.1.0-alpha.2"
|
| 23 |
ezbee = "^0.1.0"
|
|
|
|
| 24 |
|
| 25 |
[tool.poe.executor]
|
| 26 |
type = "poetry"
|
|
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "litbee"
|
| 3 |
+
version = "0.1.2-alpha.0"
|
| 4 |
description = "align (en, de, zh) texts via streamlit "
|
| 5 |
authors = ["ffreemt"]
|
| 6 |
license = "MIT"
|
|
|
|
| 21 |
streamlit = "^1.9.2"
|
| 22 |
debee = "^0.1.0-alpha.2"
|
| 23 |
ezbee = "^0.1.0"
|
| 24 |
+
streamlit-option-menu = "^0.3.2"
|
| 25 |
|
| 26 |
[tool.poe.executor]
|
| 27 |
type = "poetry"
|
run-nodemon.sh
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
# nodemon -V -w app.py -x python -m streamlit run app.py
|
| 2 |
-
nodemon -V -w . -x python -m streamlit run $1
|
|
|
|
| 1 |
# nodemon -V -w app.py -x python -m streamlit run app.py
|
| 2 |
+
LOGLEVEL=10 nodemon -V -w . -x python -m streamlit run $1
|