CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-cloudinary

Python and Django SDK for Cloudinary, a cloud-based image and video management service with comprehensive transformation, optimization, and delivery capabilities

Overall
score

94%

Overview
Eval results
Files

task.mdevals/scenario-2/

Image Quality Optimizer

A utility that generates multiple image URLs with different quality settings to help users find the optimal balance between file size and visual quality for their web applications.

Capabilities

Generate URLs with numeric quality values

  • Calling generate_quality_url("sample", 85) returns a URL containing the quality parameter q_85 @test
  • Calling generate_quality_url("photo", 100) returns a URL containing the quality parameter q_100 @test
  • Calling generate_quality_url("image", 50) returns a URL containing the quality parameter q_50 @test

Generate URLs with automatic quality optimization

  • Calling generate_quality_url("sample", "auto") returns a URL containing the quality parameter q_auto @test
  • Calling generate_quality_url("sample", "auto:good") returns a URL containing the quality parameter q_auto:good @test
  • Calling generate_quality_url("sample", "auto:best") returns a URL containing the quality parameter q_auto:best @test
  • Calling generate_quality_url("sample", "auto:eco") returns a URL containing the quality parameter q_auto:eco @test

Generate URLs with quality and transformation chains

  • Calling generate_quality_url("sample", "auto", width=800, crop="fill") returns a URL with both quality and transformation parameters @test
  • Calling compare_quality_settings("sample", [75, "auto", "auto:best"]) returns a dict with three URLs, each with different quality settings @test

Implementation

@generates

API

def generate_quality_url(public_id, quality, **transformations):
    """
    Generate a Cloudinary URL for an image with specified quality settings.

    Args:
        public_id (str): The public ID of the image on Cloudinary
        quality (int|str): Quality setting - can be integer (1-100) or string
                          ('auto', 'auto:good', 'auto:best', 'auto:eco', 'auto:low')
        **transformations: Additional transformation parameters (e.g., width, height,
                          crop, format, etc.)

    Returns:
        str: The generated Cloudinary URL with quality transformations
    """
    pass

def compare_quality_settings(public_id, quality_values, **base_transformations):
    """
    Generate multiple URLs for the same image with different quality settings.

    Args:
        public_id (str): The public ID of the image on Cloudinary
        quality_values (list): List of quality values to compare (can be integers
                              and/or strings)
        **base_transformations: Base transformation parameters to apply to all URLs

    Returns:
        dict: Dictionary mapping quality values to their respective URLs
    """
    pass

Dependencies { .dependencies }

cloudinary { .dependency }

Provides image transformation and URL generation capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-cloudinary

tile.json