Skip to main content

The goal of the App is to develop a new tool that, after receiving a few keywords given by the user, returns possibly relevant commands and other further relevant help information.

Project description

ostutor

构建说明

# 已在Openeuler测试,ubuntu需要用虚拟环境,全局安装方法尚不明确
python setup.py sdist bdist_wheel # 生成打包的源代码 & whl (仅保存文件) (可重复同一版本构建自动替换)
pip install . # 编译当下的setup并安装,本次测试使用就是这个 (可重复同一版本构建自动替换)
pip install $file # 本地安装
pip uninstall $name #

上传pypi

pip install twine
python setup.py sdist bdist_wheel
# twine upload dist/ostutor-0.x{-py3-none-any.whl,.tar.gz}
# twine upload dist/ostutor-0.4.0*
twine upload dist/ostutor-$version*

使用方式

pip install ostutor
ostutor

pip install --upgrade ostutor # update

可能报错:

  1. Installing collected packages: ostutor WARNING: The script ostutor is installed in '/home/MyAccount/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. -----or----- bash: /usr/bin/ostutor: No such file or directory
  • 如果只是WARNING但可以使用ostutor调用请忽略
  • ostutor命令无法调用软件:脚本入口被安装在了用户目录下,需要将**~/.local/bin**手动加入$PATH
# 仅加入自己的环境变量
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc
source ~/.bashrc
# 使其它用户也能调用
sudo cp /home/MyAccount/.local/bin/ostutor /usr/bin

ostutor 1.0.0

版本概述:

正式版第一版。

ostutor 0.4.4

版本概述:

fix bug and add discretion

mdsq(^o^):~/.../tool/OSTutor$ python py_run_main.py 
Usage: py_run_main.py [OPTIONS] COMMAND [ARGS]...

  OSTutor - OpenEuler Application Assistant.

Options:
  --help  Show this message and exit.

Commands:
  apikey    Setting apikey.
  ask       Get all instructions by demand
  cli       Command line retrieval.
  data      Data export and import.
  getcom    Get the last command from the terminal and record it to the...
  install   Do not differentially download the rpm package from the...
  lrefresh  Refresh the knowledge base locally.
  nodata    Search for local instructions without data.
  pull      Data import.
  push      Data export.
  query     Query detailed information about a specified instruction.
  rpmsexp   Export the local RPM list to the current directory.
  search    Search by keyword.
  terminal  Open the terminal interface.
  tui       Start the user terminal ui.
  version   Print the version of ostutor.

ostutor 0.4.2

版本概述:

更新ostutor功能:

Usage: py_run_main.py [OPTIONS] COMMAND [ARGS]...

  OSTutor - OpenEuler Application Assistant.

Options:
  --help  Show this message and exit.

Commands:
  apikey    Setting apikey.
  ask
  cli       Command line retrieval.
  data      Data export and import.
  fixcom
  getcom
  install   Do not differentially download the rpm package from the...
  lrefresh  Refresh the knowledge base locally.
  nodata    Search for local instructions without data.
  pull      Data import.
  push      Data export.
  query     Query detailed information about a specified instruction.
  rpmsexp   Export the local RPM list to the current directory.
  search    Search by keyword.
  terminal  Open the terminal interface.
  tui       Start the user terminal ui.
  version   Print the version of ostutor.

ostutor 0.3

pip install ostutor==0.3.1

版本概述:

  • 更新ostutor
  • 增加部分依赖及whl包描述信息
  • 修复bug: 不能使用内置数据库

文件说明及改进方向

.
├── build
├── dist                               # 生成whl包的目录
├── MANIFEST.in                        # 注明构建时需要的文件 todo* 根据实际情况改写
├── OSTutor                            # 实际源代码 
│   ├── __init__.py                    # todo*去除冗余__init__.py
│   ├── __main__.py
│   ├── requirements.txt
│   ├── src                            # todo*统一绝对路径写法
│   │                                  # "data/collection.py""data/sorage.py",本机扫描模块存在大量相对路径
│   └── test.py
├── ostutor.egg-info
├── README.md
└── setup.py                           # 构建配置 todo*完善setup文件:增加依赖信息、增加作者、长描述地址、发布地址、作者等

ostutor 0.2

版本概述:

此版本目的仅为运行成功

代码改动:

  • 导包全换成相对路径,例如"from src.data" -> "from ..data"

  • 文件大多数粗略替换为绝对路径(相对路径代码报错:找不到文件)

  • 注意:OStutor/__main__.py中,

    • "from .src import cmd"打包后正常导包,但无法通过 “pyhton3 main.py”运行
    • "from src import cmd"通过 “pyhton3 main.py”运行,但打包后不能正常导包,

文件说明及改进方向

.
├── build
├── dist
│   ├── ostutor-0.2-py3-none-any.whl   # 打包whl包含的数据
│   └── ostutor-0.2.tar.gz             #生成源代码压缩包
├── MANIFEST.in                        # 注明构建时需要的文件 todo* 根据实际情况改写
├── OSTutor                            # 实际源代码 
│   ├── __init__.py                    # todo*去除冗余__init__.py
│   ├── __main__.py
│   ├── requirements.txt
│   ├── src                            # todo*统一绝对路径写法
│   └── test.py
├── ostutor.egg-info
├── README.md
└── setup.py                           # 构建配置 todo*完善setup文件:增加依赖信息、增加作者、长描述地址、发布地址、作者等

构建说明

预下载

运行‘训练模型模块’前提,有个py库函数需要下载数据源,仅需运行一次,在/OSTutor/src/data/process.py,但下载不稳定,所以请预先下载:

python3
# 进入Python shell
import nltk
nltk.download('stopwords') # 停用词
nltk.download('punkt') # 分割词语
nltk.download('wordnet') #同义词
# wordnet下载时间较长,特别在无代理的情况下,有几十兆,可下载离线版本

# 手动下载
import nltk
print(nltk.data.path)
# 一般是$HOME/nltk_data
~/nltk_data$ tree
.
├── corpora
│   ├── stopwords......
│   ├── stopwords.zip
│   └── wordnet.zip
└── tokenizers
    ├── punkt......
    └── punkt.zip
5 directories, 73 files

# 下面是我的nltk_data,不知道是否能直接使用
# https://www.123pan.com/s/6a99-Dwbi3.html
# 下载后直接解压到 $HOME

构建命令

# 已在Openeuler测试,ubuntu需要用虚拟环境,全局安装方法尚不明确

python setup.py sdist bdist_wheel # 生成打包的源代码 & whl (仅保存文件) (可重复同一版本构建自动替换)
pip install . # 编译当下的setup并安装,本次测试使用就是这个 (可重复同一版本构建自动替换)
pip install $file # 本地安装
pip uninstall $name #卸载

运行

[sztu@openeuler tem]$ pip show ostutor # 包信息
Name: ostutor
Version: 0.2
Summary:
Home-page:
Author:
Author-email:
License:
Location: /home/sztu/.local/lib/python3.9/site-packages
Requires:
Required-by:

[sztu@openeuler tem]$ ostutor # 输出提示信息
Usage: ostutor [OPTIONS] COMMAND [ARGS]...

  OSTutor - OpenEuler Application Assistant.

Options:
  --help  Show this message and exit.

Commands:
  cli       Command line retrieval.
  dataexp
  dataimp   Import the specified json file to the database.
  install   Do not differentially download the rpm package from the...
  lrefresh  Refresh the knowledge base locally.
  nodata    Search for local instructions without data.
  rpmsexp   Export the local RPM list to the current directory.
  terminal  Open the terminal interface.
  ui        Start user interface mode.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ostutor-1.0.1.tar.gz (77.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ostutor-1.0.1-py3-none-any.whl (94.7 MB view details)

Uploaded Python 3

File details

Details for the file ostutor-1.0.1.tar.gz.

File metadata

  • Download URL: ostutor-1.0.1.tar.gz
  • Upload date:
  • Size: 77.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for ostutor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0d6d08f80a19bb1242181506b7beaf1af994d8061111f90e6c2ae250e53c312f
MD5 0738489ed107ff347b96979ced2f448e
BLAKE2b-256 5acaa82f175e6f94798f80260e4ecee665d9fe0bc7153759b31830361fecb5c4

See more details on using hashes here.

File details

Details for the file ostutor-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ostutor-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 94.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for ostutor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e5179a94b7495deef580a02a375789318e7c1cb07fcfeea7b15c0cf67101cc5
MD5 34c482576c1fb9250e180a13af6d80b5
BLAKE2b-256 78f1e98961e7d3ba28c2b78a98a19215759d7b0e75b934378893dcd590e2d875

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page