Skip to main content

PeaSTB - Python Environment Analyzer

Project description

PeaSTB - Python Environment Analyzer

PeaSTB inspects your current Python environment and prints a structured report.

What It Reports

PeaSTB can report the following information:

  • Report metadata: date, computer name, and user name
  • Operating System Information (platform): system, release, version, and architecture
  • Used Python Information (sys.executable, platform.python_version): executable path and Python version
  • Environment Paths (which/where): reachable Python and pip commands with resolved paths
  • Pip Executable Paths (shutil.which): detected pip and pip3 executables
  • Version Information (--version): output of python --version, pip --version, and pip3 --version
  • Installed Packages (pip list --verbose): package name mapped to version and installation path
  • Module Search Paths (sys.path): Python module search path entries from sys.path
  • Site Packages Paths (site.getsitepackages): paths returned by site.getsitepackages()
  • User Site Packages Paths (site.getusersitepackages): user-level site-packages path
  • Virtual Environment Status (sys.prefix vs sys.base_prefix): whether a virtual environment is active and where it is located

If you provide --packagefile, PeaSTB also adds:

  • Package Import Check (importlib.import_module): per-package import result
  • Package Import Summary (count): counts of successful and failed imports

Installation

Install from PyPI with pip:

pip install peastb

or

python -m pip install peastb

Usage

Show the command-line help:

peastb --help

Help text:

usage: peastb [-h] [--version] [--analyze] [--outputfile OUTPUTFILE] [--outputfileonly]
              [--packagefile PACKAGEFILE] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

PeaSTB - Python Environment Analyzer

options:
  -h, --help            show this help message and exit
  --version             Shows the current version of the Python Environment Analyzer.
  --analyze             Analyzes the Python Environment.
  --outputfile OUTPUTFILE
                        Writes the analysis output to the given file path.
  --outputfileonly      Writes output only to the output file. Requires --outputfile.
  --packagefile PACKAGEFILE
                        Path to a text file with package names (one package per line) to check
                        imports for.
  --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Sets the log level for peastb.log (default: INFO).

Logging:

  • Log file: peastb.log
  • Existing content is preserved (append mode)
  • Default log level: INFO

Example with debug logging:

peastb --analyze --loglevel DEBUG

Run a full analysis with package checks:

peastb --analyze --packagefile sample_packages.txt

You can also run the module directly:

python -m peastb.pea01_main --analyze --packagefile sample_packages.txt

Package File Example

# sample package list
sys
colorama
non_existing_demo_package

A package file tailored to the BK GuT environment is included in the GitHub repository.

Version

Current version: 0.1.0a3

Repository

Source code and project history are available on GitHub:

License

MIT © Markus Breuer.

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

peastb-0.1.0a3.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

peastb-0.1.0a3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file peastb-0.1.0a3.tar.gz.

File metadata

  • Download URL: peastb-0.1.0a3.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.8.0-124-generic

File hashes

Hashes for peastb-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 20895e60d6e8d004af3ecafca968497e1be21883607ac290c7c9f00f835f0f7a
MD5 727330b41bc4ddf36cec0321b0c0ba39
BLAKE2b-256 caf97b549d8bc5f055830d78a5fe0aee47802c18f89bade451329ec60d98a7e6

See more details on using hashes here.

File details

Details for the file peastb-0.1.0a3-py3-none-any.whl.

File metadata

  • Download URL: peastb-0.1.0a3-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.8.0-124-generic

File hashes

Hashes for peastb-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 06d07d0eb9db87389813d834bf26f1e94943bc90d6833fe20710b78e10e90fe9
MD5 8d5eec778d21ee97b2b84b5e9f72cbe6
BLAKE2b-256 71104056deba506c8c70e1b208676c1ba5d46af42e5f101acdf3b87e659a01f9

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