diff --git a/pyproject.toml b/pyproject.toml index 9330f33..87782db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "notion-nlp" -version = "1.0.7.2" +version = "1.0.7.3" description = "Reading rich text information from a Notion database and performing simple NLP analysis." authors = ["Dario Zhang "] license = "MIT license" diff --git a/release.sh b/release.sh index 4d08e3c..c6f427f 100644 --- a/release.sh +++ b/release.sh @@ -1,22 +1,29 @@ #!/bin/bash -# dir name -dir=$(basename $(dirname $0)) +# Get current working directory with full path +fullPath=$(pwd) +# Get only directory name without path +dirNameOrigin=$(basename $fullPath) +dirName=${dirNameOrigin//-/_} +echo $dirName # pypi token pypi_token=$(cat PYPI_TOKEN) # 从__init__.py文件中读取版本信息 -version=$(python -c "from src.$dir import __version__; print(__version__)") +version=$(python -c "from src.$dirName import __version__; print(__version__)") +echo $version # build & publish -poetry build && \ -poetry publish -u __token__ -p $pypi_token +/usr/bin/python3.8 -m poetry build && \ +/usr/bin/python3.8 -m poetry publish -u __token__ -p $pypi_token # pyinstaller linux exec file -pyinstaller -F src/$dir/__main__.py -n $dir-linux && \ +/usr/bin/python3.8 -m poetry run pyinstaller -F src/$dirName/__main__.py -n $dirNameOrigin-linux && \ # Compress the executable file -zip ./dist/$dir-linux.zip ./dist/$dir-linux ./scripts/Chinese-simple.sh scripts/English.sh scripts/start.sh +zip -j ./dist/$dirNameOrigin-$version-linux.zip ./dist/$dirNameOrigin-linux ./scripts/Chinese-simple.sh scripts/English.sh scripts/start.sh -zip dist/$dir-win64.zip dist/$dir-win64.exe scripts/Chinese-simple.bat scripts/English.bat scripts/start.bat \ No newline at end of file +zip -j ./dist/$dirNameOrigin-$version-win64.zip ./dist/$dirNameOrigin-win64.exe scripts/Chinese-simple.bat scripts/English.bat scripts/start.bat + +# todo 把停用词也更新了 \ No newline at end of file diff --git a/scripts/Chinese-simple.bat b/scripts/Chinese-simple.bat index c7f30eb..e5b414f 100644 --- a/scripts/Chinese-simple.bat +++ b/scripts/Chinese-simple.bat @@ -34,7 +34,7 @@ color 0a echo ================== ☆ Notion 自然语言处理 ☆ ====================== echo= echo 作者: Dario Zhang -echo 版本: v1.0.7.2 +echo 版本: v1.0.7.3 echo 代码: https://github.com/dario-github/notion-nlp echo 描述: 从Notion数据库中读取文本并进行自然语言处理分析 echo= diff --git a/scripts/English.bat b/scripts/English.bat index 11b439f..65f988b 100644 --- a/scripts/English.bat +++ b/scripts/English.bat @@ -36,7 +36,7 @@ color 0a echo ============ Notion Natural Language Processing ================= echo= echo Author: Dario Zhang -echo Version: v1.0.7.2 +echo Version: v1.0.7.3 echo Code: https://github.com/dario-github/notion-nlp echo Description: Read text from the Notion database and perform natural echo language processing analysis diff --git a/src/notion_nlp/__init__.py b/src/notion_nlp/__init__.py index a8256e6..c51b45b 100644 --- a/src/notion_nlp/__init__.py +++ b/src/notion_nlp/__init__.py @@ -1,4 +1,4 @@ -__version__ = "1.0.7.2" +__version__ = "1.0.7.3" from . import core, parameter from .core.task import first_try, run_all_tasks, run_task, task_info from .parameter import log diff --git a/src/notion_nlp/core/task.py b/src/notion_nlp/core/task.py index 7590342..9f3056c 100644 --- a/src/notion_nlp/core/task.py +++ b/src/notion_nlp/core/task.py @@ -77,7 +77,7 @@ def task_info( """查看任务信息 Args: - config_file (str, optional): 参数文件地址. Defaults to "notion_nlp/configs/config.yaml". + config_file (str, optional): 参数文件地址. Defaults to "notion-nlp-dataset/configs/config.yaml". """ config = load_config(config_file) if not config.tasks_with_diff_name(): @@ -110,9 +110,9 @@ def run_task( task (TaskParams, optional): 任务信息参数类. Defaults to None. task_json (str, optional): 任务信息json字符串. Defaults to None. task_name (str, optional): 任务名. Defaults to None. - config_file (str, optional): 参数文件地址. Defaults to "notion_nlp/configs/config.yaml". + config_file (str, optional): 参数文件地址. Defaults to "notion-nlp-dataset/configs/config.yaml". download_stopwords (bool, optional): 是否下载停用词. Defaults to False. - stopfiles_dir (str, optional): 停用词文件目录. Defaults to "notion_nlp/stopwords". + stopfiles_dir (str, optional): 停用词文件目录. Defaults to "notion-nlp-dataset/stopwords". stopfiles_postfix (str, optional): 停用词文件后缀. Defaults to "stopwords.txt". Raises: @@ -181,7 +181,7 @@ def run_all_tasks( """运行所有任务 Args: - config_file (str, optional): 参数文件地址. Defaults to "notion_nlp/configs/config.yaml". + config_file (str, optional): 参数文件地址. Defaults to "notion-nlp-dataset/configs/config.yaml". """ # 打印所有任务信息 task_info(config_file) diff --git a/src/notion_nlp/core/visual.py b/src/notion_nlp/core/visual.py index a055538..632f242 100644 --- a/src/notion_nlp/core/visual.py +++ b/src/notion_nlp/core/visual.py @@ -21,7 +21,7 @@ def word_cloud_plot( font_path: Optional[str] = None, width: int = 800, # TODO 词云图的宽、高也放到task参数中(作为可选项) height: int = 450, - colormap: str = "viridis", # TODO 词云图的颜色也是可选项,可以指定自己想要的颜色 + colormap: str = "viridis", font_show: str = "chinese.stzhongs.ttf", ): """绘制词云图