Skip to main content

Module python_crawler

Module python_crawler 

Source

Structs§

PythonCrawler
Python ecosystem crawler for discovering packages in site-packages.

Functions§

canonicalize_pypi_name
Canonicalize a Python package name per PEP 503.
find_local_venv_site_packages
Find local virtual environment site-packages directories.
find_python_command
Find a working Python command on the system.
find_python_command_with
Version of find_python_command that accepts an injected CommandRunner. Tests inject a MockCommandRunner that returns Some(...) for python3 --version to exercise the success arm without a real Python on PATH.
find_python_dirs
Find directories matching a path pattern with wildcard segments.
find_site_packages_under
Find site-packages (or dist-packages) directories under a base dir.
get_global_python_site_packages
Get global/system Python site-packages directories.
parse_python_site_packages_output
Pure parser for python -c "import site; print(...); print(site.getusersitepackages())" stdout. Splits the output on newlines, trims each line, discards empty lines, and returns the remaining lines as PathBufs. Extracted so the path-derivation logic is unit-testable without a real Python interpreter.
read_python_metadata
Read Name and Version for a .dist-info directory.