freemt commited on
Commit ·
2236e6d
1
Parent(s): 79037e9
Bump version from 0.1.2-alpha.3 to 0.1.2
Browse files- README1.md +8 -11
- app.py +4 -1
- litbee/__init__.py +1 -1
- litbee/app.py +4 -1
- litbee/home.py +2 -1
- pyproject.toml +4 -4
README1.md
CHANGED
|
@@ -8,29 +8,26 @@ Python 3.8 only
|
|
| 8 |
|
| 9 |
`pyicu`, `pycld2` and `fasttext`: refer to `debee`'s pre-install [https://github.com/ffreemt/debee/blob/main/README.md](https://github.com/ffreemt/debee/blob/main/README.md)
|
| 10 |
|
| 11 |
-
##
|
|
|
|
| 12 |
```bash
|
| 13 |
pip install litbee
|
| 14 |
python -m litbee
|
| 15 |
```
|
| 16 |
|
| 17 |
-
## Or via git clone
|
| 18 |
-
```
|
| 19 |
git clone https://github.com/ffreemt/litbee
|
| 20 |
cd litbee
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
## Install it
|
| 24 |
-
```shell
|
| 25 |
-
poetry install
|
| 26 |
-
|
| 27 |
-
# or pip install -r requirements.txt
|
| 28 |
```
|
| 29 |
|
| 30 |
## Use it
|
| 31 |
```bash
|
| 32 |
-
python -m
|
| 33 |
|
|
|
|
| 34 |
# or streamlit run app.py
|
| 35 |
-
# or python -m litbee
|
| 36 |
```
|
|
|
|
| 8 |
|
| 9 |
`pyicu`, `pycld2` and `fasttext`: refer to `debee`'s pre-install [https://github.com/ffreemt/debee/blob/main/README.md](https://github.com/ffreemt/debee/blob/main/README.md)
|
| 10 |
|
| 11 |
+
## Install it
|
| 12 |
+
### via pip
|
| 13 |
```bash
|
| 14 |
pip install litbee
|
| 15 |
python -m litbee
|
| 16 |
```
|
| 17 |
|
| 18 |
+
### Or via git clone
|
| 19 |
+
```bash
|
| 20 |
git clone https://github.com/ffreemt/litbee
|
| 21 |
cd litbee
|
| 22 |
+
pip install -r requirements.txt
|
| 23 |
+
# or poetry install
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
```
|
| 26 |
|
| 27 |
## Use it
|
| 28 |
```bash
|
| 29 |
+
python -m litbee
|
| 30 |
|
| 31 |
+
# or git clone and python -m streamlit run app.py
|
| 32 |
# or streamlit run app.py
|
|
|
|
| 33 |
```
|
app.py
CHANGED
|
@@ -96,7 +96,10 @@ msg = f"Some packages litbee depends on can only run with Python 3.8, current py
|
|
| 96 |
assert curr_py == "3.8", msg
|
| 97 |
|
| 98 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
# uncomment this in dev oe set/export LOGLEVEL=10
|
| 102 |
# os.environ["LOGLEVEL"] = "10"
|
|
|
|
| 96 |
assert curr_py == "3.8", msg
|
| 97 |
|
| 98 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 99 |
+
try:
|
| 100 |
+
time.tzset()
|
| 101 |
+
except Exception as _:
|
| 102 |
+
logger.warning("time.tzset() error: %s. Probably running Windows, we let it pass.", _)
|
| 103 |
|
| 104 |
# uncomment this in dev oe set/export LOGLEVEL=10
|
| 105 |
# os.environ["LOGLEVEL"] = "10"
|
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.2"
|
| 3 |
from .litbee import litbee
|
| 4 |
|
| 5 |
__all__ = ("litbee",)
|
litbee/app.py
CHANGED
|
@@ -96,7 +96,10 @@ msg = f"Some packages litbee depends on can only run with Python 3.8, current py
|
|
| 96 |
assert curr_py == "3.8", msg
|
| 97 |
|
| 98 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
# uncomment this in dev oe set/export LOGLEVEL=10
|
| 102 |
# os.environ["LOGLEVEL"] = "10"
|
|
|
|
| 96 |
assert curr_py == "3.8", msg
|
| 97 |
|
| 98 |
os.environ["TZ"] = "Asia/Shanghai"
|
| 99 |
+
try:
|
| 100 |
+
time.tzset()
|
| 101 |
+
except Exception as _:
|
| 102 |
+
logger.warning("time.tzset() error: %s. Probably running Windows, we let it pass.", _)
|
| 103 |
|
| 104 |
# uncomment this in dev oe set/export LOGLEVEL=10
|
| 105 |
# os.environ["LOGLEVEL"] = "10"
|
litbee/home.py
CHANGED
|
@@ -273,7 +273,8 @@ def home(): # noqa
|
|
| 273 |
dl_xlsx = f'<a href="data:application/octet-stream;base64,{b64.decode()}" download="{filename}aligned_paras.xlsx">Download aligned paras xlsx</a>'
|
| 274 |
|
| 275 |
output = io.BytesIO()
|
| 276 |
-
df_a.astype(str).to_csv(output, sep="\t", index=False, header=False, encoding="gbk")
|
|
|
|
| 277 |
output.seek(0)
|
| 278 |
|
| 279 |
val = output.getvalue()
|
|
|
|
| 273 |
dl_xlsx = f'<a href="data:application/octet-stream;base64,{b64.decode()}" download="{filename}aligned_paras.xlsx">Download aligned paras xlsx</a>'
|
| 274 |
|
| 275 |
output = io.BytesIO()
|
| 276 |
+
# df_a.astype(str).to_csv(output, sep="\t", index=False, header=False, encoding="gbk")
|
| 277 |
+
df_a.astype(object).to_csv(output, sep="\t", index=False, header=False, encoding="gbk")
|
| 278 |
output.seek(0)
|
| 279 |
|
| 280 |
val = output.getvalue()
|
pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "litbee"
|
| 3 |
-
version = "0.1.2
|
| 4 |
description = "align (en, de, zh) texts via streamlit "
|
| 5 |
authors = ["ffreemt"]
|
| 6 |
license = "MIT"
|
|
@@ -48,10 +48,10 @@ isort = "isort tests litbee"
|
|
| 48 |
black = "black tests litbee"
|
| 49 |
format = ["isort", "black"]
|
| 50 |
docstyle = "pydocstyle --convention=google tests litbee"
|
| 51 |
-
|
| 52 |
prerelease = {cmd = "poetry version prerelease && sync-version"}
|
| 53 |
-
git = {cmd = "git
|
| 54 |
-
deploy = ["
|
| 55 |
tunnel = {cmd = "ssh -CN ip_or_hostname_defined_in_hosts -L 9091:127.0.0.1:9091"}
|
| 56 |
|
| 57 |
[tool.poetry.dev-dependencies]
|
|
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "litbee"
|
| 3 |
+
version = "0.1.2"
|
| 4 |
description = "align (en, de, zh) texts via streamlit "
|
| 5 |
authors = ["ffreemt"]
|
| 6 |
license = "MIT"
|
|
|
|
| 48 |
black = "black tests litbee"
|
| 49 |
format = ["isort", "black"]
|
| 50 |
docstyle = "pydocstyle --convention=google tests litbee"
|
| 51 |
+
cpapp = "cp app.py litbee"
|
| 52 |
prerelease = {cmd = "poetry version prerelease && sync-version"}
|
| 53 |
+
git = {cmd = "git push && git push github"}
|
| 54 |
+
deploy = ["cpapp", "export", "git"]
|
| 55 |
tunnel = {cmd = "ssh -CN ip_or_hostname_defined_in_hosts -L 9091:127.0.0.1:9091"}
|
| 56 |
|
| 57 |
[tool.poetry.dev-dependencies]
|