HelpDev - 轻松提取有关 Python 环境的信息。
项目描述
帮助用户和开发人员获取有关环境的信息以报告错误甚至测试您的系统,而无需花费一天的时间。它可以获取有关硬件、操作系统、路径、Python 分发和包的信息,包括 Qt-things。在 Linux、Windows 和 Mac 中运行。使用 Python 2.7+ 和 Python 3.4+。
如果您想在应用程序运行时获取信息,则需要使用运行应用程序的相同环境(和进程)进行调用。该模块可以导入并集成到您的应用程序中,提供有关当前环境的报告。
一些信息可能依赖或独立于您的 Python 环境,而另一些信息可能依赖于您正在运行的应用程序。因此,有一些缩写词用来指代它们:
PEI:独立于 Python 环境;
PED:Python 环境依赖;
PEAD:Python 环境和应用程序依赖。
警告:
此脚本不应使用选项--all获取个人信息 ,但您必须在使用输出之前检查信息。
使用选项--all-for-sure它添加了有关可以显示个人信息的路径和变量的信息。因此,在网络上发布时请务必使用此选项。
对于此脚本提供的信息的不当使用或问题,我概不负责,但如果在问题中指出,我可以帮助修复它。
安装、更新和卸载
要安装和/或更新,请执行
$ pip install -U helpdev
去除
$ pip uninstall helpdev
跑步
您只需要在终端中运行下面的行。
获得极简输出
$ helpdev
过滤一组包以获取信息,其中列出了所有以 sphinx、qtpy 和 pyqt5 开头的包
$ helpdev --packages="sphinx.*,qtpy,PYQT5"
在没有个人信息的情况下获得完整的输出
$ helpdev --all
获得包含个人信息的完整输出
$ helpdev --all-for-sure
获取一些帮助信息
$ helpdev --help
v0.6 中的示例
帮助
$ helpdev --help
usage: helpdev
[--hardware] [--os] [--thread] [--network [NETWORK]]
[--distributions] [--python] [--conda]
[--qt] [--qt-bindings] [--qt-abstractions]
[--packages [PACKAGES]]
[--packages-pip] [--packages-pip-e]
[--packages-conda] [--packages-conda-e]
[--numbers] [--float] [--int]
[--personal] [--path] [--scope]
[--all]
[--all-for-sure]
[--version]
[--help]
HelpDev - Extracts information about the Python environment easily.
optional arguments:
--hardware CPU, memory and architecture (PEI)
--os Operating system (PEI)
--thread Threads specification in the system (PEI)
--network [NETWORK] Network information, DNS and load for usual sites
(PEI). NETWORK timeout defaults to 5s. 0 is disabled
--distributions All options for distributions below (PED)
--python Python distribution (PED)
--conda Conda/Anaconda Python distribution (PED)
--qt All options for Qt below (PEAD)
--qt-bindings Available Qt bindings (PyQt/Pyside) (PEAD)
--qt-abstractions Available Qt abstractions (QtPy/Qt.Py/PyQtGraph) (PEAD)
--packages [PACKAGES] All options for packages below, except '-e' (PED)
Filter PACKAGE(s) to report. Accepts regex, separator is ','
--packages-pip PIP installed packages + PIP check (PED)
--packages-pip-e PIP locally installed packages + PIP check (PED)
--packages-conda CONDA installed packages (PED)
--packages-conda-e CONDA locally installed packages (PED)
--numbers All options for numbers below (PEI)
--float Float representation in the system (PEI)
--int Integer representation in the system (PEI)
--personal All options for personal information below (PEAD)
--path Show Python current paths i.e. 'sys.path' (PEAD)
--scope Show Python current scope i.e. 'dir()' (PEAD)
--all Run all options above, except 'personal' (PEAD)
--all-for-sure Run all options above, INCLUDING 'PERSONAL' (PEAD)
--version, -v Show program's version number and exit
--help, -h Show this help message and exit
使用 –packages 过滤器
此过滤功能提供了要报告的软件包的干净列表。它接受正则表达式。每个表达式必须用逗号分隔。
基本正则表达式检查包名称的开始直到结束,它们不区分大小写。
# gets all that starts with 'sphinx', 'qtpy' and 'PYQT5' (not case sensitive)
$ helpdev --packages="sphinx.*,qtpy,PYQT5"
* PYTHON PACKAGES---------------------------------------
- PyQt5......................... 5.12.1
- QtPy.......................... 1.7.0
- Sphinx........................ 2.0.1
- sphinx-rtd-theme.............. 0.4.3
- sphinxcontrib-applehelp....... 1.0.1
- sphinxcontrib-bibtex.......... 0.4.2
- sphinxcontrib-devhelp......... 1.0.1
- sphinxcontrib-excel........... 0.0.1
- sphinxcontrib-fulltoc......... 1.2.0
- sphinxcontrib-htmlhelp........ 1.0.2
- sphinxcontrib-jsmath.......... 1.0.1
- sphinxcontrib-plantuml........ 0.15
- sphinxcontrib-qthelp.......... 1.0.2
- sphinxcontrib-serializinghtml. 1.1.3
* CONDA PACKAGES-----------------------------------------
- pyqt5......................... 5.12.1
- qtpy.......................... 1.7.0
- sphinx........................ 2.0.1
- sphinx-rtd-theme.............. 0.4.3
- sphinxcontrib-applehelp....... 1.0.1
- sphinxcontrib-bibtex.......... 0.4.2
- sphinxcontrib-devhelp......... 1.0.1
- sphinxcontrib-excel........... 0.0.1
- sphinxcontrib-fulltoc......... 1.2.0
- sphinxcontrib-htmlhelp........ 1.0.2
- sphinxcontrib-jsmath.......... 1.0.1
- sphinxcontrib-plantuml........ 0.15
- sphinxcontrib-qthelp.......... 1.0.2
- sphinxcontrib-serializinghtml. 1.1.3
此代码基于以下许多其他脚本:
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。