or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/cloudinary@1.44.x
tile.json

tessl/pypi-cloudinary

tessl install tessl/pypi-cloudinary@1.44.0

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

Agent Success

Agent success rate when using this tile

94%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.08x

Baseline

Agent success rate without this tile

87%

task.mdevals/scenario-4/

Image Asset Report Generator

Build a system that generates reports on image assets stored in a cloud media management service, using search functionality to query and analyze large collections of images.

Requirements

Your system should provide a function that generates a comprehensive report based on search criteria. The function should:

  1. Search for images that match specific criteria (format, size, tags, date range)
  2. Sort results by creation date in descending order (newest first)
  3. Handle pagination to retrieve all matching results, not just the first page
  4. Return summary statistics including:
    • Total number of images found
    • List of image identifiers
    • Total storage size in bytes
    • Average file size

Input Parameters

The function should accept the following parameters:

  • format_type: Image format to filter by (e.g., "jpg", "png")
  • min_bytes: Minimum file size in bytes (optional, defaults to 0)
  • tag: Tag to filter by (optional)
  • days_back: Number of days to look back from today (optional)

Return Value

Return a dictionary containing:

  • total_count: Total number of matching images
  • image_ids: List of public IDs for all matching images
  • total_bytes: Combined size of all images in bytes
  • average_bytes: Average file size rounded to nearest integer

Test Cases

  • Given images with format "jpg" and no other filters, the function returns all JPG images with correct totals @test
  • Given a minimum file size of 100000 bytes, the function only returns images that meet or exceed that size @test
  • Given a tag filter "product", the function returns only images tagged with "product" @test
  • Given multiple pages of results (more than 500 images), the function correctly paginates through all results @test

Implementation

@generates

API

def generate_image_report(format_type, min_bytes=0, tag=None, days_back=None):
    """Generate a report on images matching the specified criteria.

    Args:
        format_type (str): Image format to filter by (e.g., "jpg", "png")
        min_bytes (int, optional): Minimum file size in bytes. Defaults to 0.
        tag (str, optional): Tag to filter by. Defaults to None.
        days_back (int, optional): Number of days to look back. Defaults to None.

    Returns:
        dict: Report containing:
            - total_count (int): Total number of matching images
            - image_ids (list): List of public IDs
            - total_bytes (int): Combined size in bytes
            - average_bytes (int): Average file size
    """

Dependencies { .dependencies }

cloudinary { .dependency }

Provides cloud-based media management capabilities including search, filtering, and pagination functionality.

@satisfied-by