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.0a5

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.0a5.tar.gz (8.9 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.0a5-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peastb-0.1.0a5.tar.gz
  • Upload date:
  • Size: 8.9 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.0a5.tar.gz
Algorithm Hash digest
SHA256 dfcc8be57def32bb4166d3e67c1fa2fe754ee872e29d65c7ac9aff2d1f7f3b29
MD5 683feaf2213a97ef09ae733c6d0d867d
BLAKE2b-256 405d6c6b25ec237421cdcc51e2549b806ec657b67db90cb624b54a593f5c7de9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: peastb-0.1.0a5-py3-none-any.whl
  • Upload date:
  • Size: 10.9 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.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 649a36cef32e551bb6be892efd6f4f3af924dfee4bd5e9cb0eeb0947866f7bd3
MD5 b109d22e5470318880db4b9a4fde25a4
BLAKE2b-256 4fcb8f55006e54e996aa46956ea829b2940e111261d203c799eba88ed40b7405

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