or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

core-analysis.mddata-extraction.mdindex.mdrating-system.md
tile.json

tessl/pypi-pyroma

Python packaging quality assessment tool that evaluates how well Python projects comply with best practices of the Python packaging ecosystem.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pyroma@4.3.x

To install, run

npx @tessl/cli install tessl/pypi-pyroma@4.3.0

index.mddocs/

Pyroma

A 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.

Package Information

  • Package Name: pyroma
  • Language: Python
  • Installation: pip install pyroma
  • Python Requires: >=3.9

Core Imports

import pyroma

For running the analysis programmatically:

from pyroma import run
from pyroma.ratings import rate

For data extraction modules:

from pyroma import projectdata, distributiondata, pypidata

Basic Usage

Command Line Usage

# 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 .

Programmatic Usage

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}")

Architecture

Pyroma follows a modular architecture with clear separation of concerns:

  • Analysis Engine: Core rating system with pluggable tests
  • Data Extractors: Specialized modules for different source types (projects, distributions, PyPI)
  • Rating System: Comprehensive test suite evaluating packaging best practices
  • CLI Interface: Command-line tool with flexible analysis modes

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.

Capabilities

Core Analysis Functions

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): ...

Core Analysis

Data Extraction

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: ...

Data Extraction

Rating System

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: ...

Rating System