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-2/

Cloud Media Service Configuration Manager

Overview

Build a Python utility that manages configuration for a cloud-based media service. The utility must load credentials from environment variables and provide a simple way to verify the configuration is set up correctly.

Requirements

Create a module config_manager.py that implements the following functionality:

1. Configuration Loading

  • Load configuration from a URL-formatted environment variable
  • Support loading cloud name, API key, and API secret from the environment
  • Allow programmatic configuration setup (setting values via code)

2. Configuration Retrieval

  • Provide a way to retrieve the current configuration settings
  • Return the cloud name, API key, and API secret values

3. Configuration Validation

  • Check that all required parameters are set (cloud name, API key, API secret)
  • Raise a clear error if any required configuration is missing

Implementation Notes

  • Focus on configuration management only
  • The configuration should be retrievable for verification purposes
  • Keep the implementation straightforward

Test Cases { .test-cases }

Test Case 1: Load configuration from environment variable { .test-case @test }

File: test_config.py { .test-file }

Setup:

import os
os.environ['CLOUDINARY_URL'] = 'cloudinary://123456789012345:abcdefghijklmnopqrstuvwxyz123456@test-cloud'

Expected behavior:

  • Configuration manager successfully loads cloud name, API key, and API secret
  • Cloud name should be 'test-cloud'
  • API key should be '123456789012345'
  • API secret should be 'abcdefghijklmnopqrstuvwxyz123456'

Test Case 2: Missing configuration raises error { .test-case @test }

File: test_config.py { .test-file }

Setup:

import os
# Clear any existing Cloudinary configuration
for key in list(os.environ.keys()):
    if key.startswith('CLOUDINARY'):
        del os.environ[key]

Expected behavior:

  • Attempting to validate configuration without proper setup should raise an exception
  • The exception should indicate missing required configuration

Test Case 3: Manual configuration setup { .test-case @test }

File: test_config.py { .test-file }

Setup:

# No environment variables set

Expected behavior:

  • Configuration manager allows setting cloud name, API key, and API secret programmatically
  • Configuration can be retrieved to verify the values were set correctly
  • All three parameters (cloud_name, api_key, api_secret) should be accessible

Dependencies { .dependencies }

cloudinary { .dependency }

Python SDK for cloud-based media management service providing upload, transformation, and delivery capabilities.