跳转到主要内容

HelpDev - 轻松提取Python环境信息。

项目描述

帮助用户和开发人员获取有关环境的信息,以报告缺陷或甚至测试您的系统,而无需花费一天时间。它可以获取有关硬件、操作系统、路径、Python发行版和包的信息,包括Qt相关内容。在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

此代码基于许多其他脚本,来自

项目详情


下载文件

下载适用于您平台上的文件。如果您不确定选择哪一个,请了解更多关于安装包的信息。

源分布

helpdev-0.7.1.tar.gz (51.6 kB 查看散列)

上传时间:

构建分布

helpdev-0.7.1-py3-none-any.whl (14.0 kB 查看散列)

上传时间: Python 3

由以下赞助商支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面