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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: peastb-0.1.0a4.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.0a4.tar.gz
Algorithm Hash digest
SHA256 151648953d6359d635c2aa6f09ccafb4cb47d22adcf2cc71bae33e2456344424
MD5 9b9e6dcf57d9b937dd03a8f583aedcdf
BLAKE2b-256 fb3298707bbfae94d9e246549499a8cecefb85db047846e82efc0ee46cdd7e39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: peastb-0.1.0a4-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.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 36531b7476af086f5250f6135cc1e22c5a0d2305bfd46aecd2cb08bfa9834882
MD5 557720adf98dd79a9d1586b8bcc3383e
BLAKE2b-256 cf4fb0fcfb1c1604ab29d2355dd8fc9681d29ad67e2278f24b32af8377330bb4

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