Python packaging quality assessment tool that evaluates how well Python projects comply with best practices of the Python packaging ecosystem.
npx @tessl/cli install tessl/pypi-pyroma@4.3.0A Python packaging quality assessment tool that evaluates how well Python projects comply with best practices of the Python packaging ecosystem, primarily PyPI, pip, and setuptools. It provides ratings and detailed feedback on project metadata quality, helping developers create more professional and usable packages.
pip install pyromaimport pyromaFor running the analysis programmatically:
from pyroma import run
from pyroma.ratings import rateFor data extraction modules:
from pyroma import projectdata, distributiondata, pypidata# Analyze a project directory
pyroma .
# Analyze a distribution file
pyroma my-package-1.0.tar.gz
# Analyze a PyPI package
pyroma requests
# Set minimum rating for clean exit
pyroma --min 8 .
# Skip specific tests
pyroma --skip-tests "BusFactor,SDist" .
# Quiet mode (only show rating)
pyroma --quiet .import pyroma
from pyroma.ratings import rate
# Run analysis on a directory
rating = pyroma.run('directory', '/path/to/project')
print(f"Rating: {rating}/10")
# Get detailed analysis with failures
from pyroma.projectdata import get_data
from pyroma.ratings import rate
data = get_data('/path/to/project')
rating, failures = rate(data)
print(f"Rating: {rating}/10")
for failure in failures:
print(f"- {failure}")Pyroma follows a modular architecture with clear separation of concerns:
The tool supports three analysis modes: directory analysis for local projects, file analysis for distribution packages, and PyPI analysis for published packages, with automatic mode detection for user convenience.
Main functions for running pyroma analysis programmatically. These functions provide the primary interface for integrating pyroma into development workflows and automation scripts.
def main(): ...
def run(mode: str, argument: str, quiet: bool = False, skip_tests: list = None) -> int: ...
def zester(data: dict): ...Functions for extracting package metadata from different sources including project directories, distribution files, and PyPI packages. These modules handle the complexities of parsing various packaging formats and configurations.
# Project data extraction
def get_data(path: str) -> dict: ...
def build_metadata(path: str, isolated: bool = None): ...
# Distribution file data extraction
def get_data(path: str) -> dict: ...
# PyPI data extraction
def get_data(project: str) -> dict: ...Comprehensive quality assessment system with pluggable tests that evaluate various aspects of Python packaging best practices. The rating system provides detailed feedback and actionable recommendations.
def rate(data: dict, skip_tests: list = None) -> tuple: ...
def get_all_tests() -> list: ...
def get_code_licenses() -> dict: ...