Note
Data Attribution: Top PyPI packages data sourced from the ClickHouse's ClickPy.
Static code quality audit of the most-downloaded PyPI libraries. Code quality analysis done using ty (Astral) and severity mapping, visualized via interactive error-density treemaps.
This repository contains no confidential data/IP and is intended for demonstration and research use.
dataset/: Contains the list of top PyPI packages.scripts/: Scripts to fetch package data, run analysis, and generate visualization data.ty_outputs/: Raw JSON output fromtyanalysis for each package.visualizer/: Web-based visualization of the analysis results.
- Python >= 3.12
uv(for package management)jq(required forgenerate_json_report.sh)
-
Install System Dependencies
sudo apt-get update && sudo apt-get install -y jq -
Install Python Dependencies
uv sync
All python scripts should be run using
uv run script_name.pyto ensure dependencies are available. -
Fetch Top Packages (Optional)
The
dataset/top-pypi-packages.jsonis already provided. To refresh it using the public ClickHouse PyPI dataset:uv run scripts/get_packages.py
-
Run Static Analysis
This script clones each repository listed in the dataset, runs
ty, and saves the output toty_outputs/.# Ensure usage permissions chmod +x scripts/generate_json_report.sh # Run the script ./scripts/generate_json_report.sh
-
Generate Visualization Data
Process the raw analysis results into a format suitable for the visualization.
uv run scripts/generate_treemap_data.py
-
View Visualization
View the live demo or open
visualizer/index.htmllocally to explore the interactive error-density treemap.