{"id":28764991,"url":"https://github.com/cloudinary/analysis-python","last_synced_at":"2025-07-11T18:11:04.466Z","repository":{"id":274545831,"uuid":"916162326","full_name":"cloudinary/analysis-python","owner":"cloudinary","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-28T00:14:24.000Z","size":120,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-06-08T22:29:45.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudinary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-13T15:17:13.000Z","updated_at":"2025-01-28T00:13:50.000Z","dependencies_parsed_at":"2025-01-28T00:26:38.099Z","dependency_job_id":"0091c2b1-b754-459e-a24f-d58692465665","html_url":"https://github.com/cloudinary/analysis-python","commit_stats":null,"previous_names":["cloudinary/analysis-python"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cloudinary/analysis-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fanalysis-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fanalysis-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fanalysis-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fanalysis-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudinary","download_url":"https://codeload.github.com/cloudinary/analysis-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fanalysis-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260336371,"owners_count":22993742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T10:13:18.680Z","updated_at":"2025-07-11T18:11:04.459Z","avatar_url":"https://github.com/cloudinary.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudinary Analysis Python SDK\n\n\u003c!-- Start Summary [summary] --\u003e\n## Summary\n\nAnalyze API (Beta): Use the Analyze API to analyze any external asset and return details based on the type of analysis requested.\n\nCurrently supports the following analysis options:\n  * [AI Vision - Tagging](https://cloudinary.com/documentation/cloudinary_ai_vision_addon#tagging_mode)\n  * [AI Vision - Moderation](https://cloudinary.com/documentation/cloudinary_ai_vision_addon#moderation_mode)\n  * [AI Vision - General](https://cloudinary.com/documentation/cloudinary_ai_vision_addon#general_mode)\n  * [Captioning](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#ai_based_image_captioning)\n  * [Cld Fashion](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_content_aware_detection_models)\n  * [Cld Text](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_content_aware_detection_models)\n  * [Coco](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_content_aware_detection_models)\n  * [Google Tagging](https://cloudinary.com/documentation/google_auto_tagging_addon)\n  * [Human Anatomy](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_content_aware_detection_models)\n  * [Image Quality Analysis](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#image_quality_analysis)\n  * [Lvis](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_content_aware_detection_models)\n  * [Shop Classifier](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_content_aware_detection_models)\n  * [Unidet](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#supported_content_aware_detection_models)\n  * [Watermark Detection](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#watermark_detection)\n\n  **Notes**: \n  * The Analyze API is currently in development and is available as a Public Beta, which means we value your feedback, so please feel free to [share any thoughts with us](https://support.cloudinary.com/hc/en-us/requests/new).\n  * The analysis options require an active subscription to the relevant add-on. Learn more about [registering for add-ons](https://cloudinary.com/documentation/cloudinary_add_ons#registering_for_add_ons).\n\n  The API supports both Basic Authentication using your Cloudinary API Key and API Secret (which can be found on the Dashboard page of your [Cloudinary Console](https://console.cloudinary.com/pm)) or OAuth2 ([Contact support](https://support.cloudinary.com/hc/en-us/requests/new) for more information regarding OAuth).\n\u003c!-- End Summary [summary] --\u003e\n\n\u003c!-- Start Table of Contents [toc] --\u003e\n## Table of Contents\n\u003c!-- $toc-max-depth=2 --\u003e\n* [Cloudinary Analysis Python SDK](#cloudinary-analysis-python-sdk)\n  * [SDK Installation](#sdk-installation)\n  * [IDE Support](#ide-support)\n  * [SDK Example Usage](#sdk-example-usage)\n  * [Authentication](#authentication)\n  * [Available Resources and Operations](#available-resources-and-operations)\n  * [Retries](#retries)\n  * [Error Handling](#error-handling)\n  * [Server Selection](#server-selection)\n  * [Custom HTTP Client](#custom-http-client)\n  * [Resource Management](#resource-management)\n  * [Debugging](#debugging)\n* [Development](#development)\n  * [Maturity](#maturity)\n  * [Contributions](#contributions)\n\n\u003c!-- End Table of Contents [toc] --\u003e\n\n\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\n\u003e [!NOTE]\n\u003e **Python version upgrade policy**\n\u003e\n\u003e Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.\n\nThe SDK can be installed with either *pip* or *poetry* package managers.\n\n### PIP\n\n*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.\n\n```bash\npip install cloudinary-analysis\n```\n\n### Poetry\n\n*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.\n\n```bash\npoetry add cloudinary-analysis\n```\n\u003c!-- End SDK Installation [installation] --\u003e\n\n\u003c!-- Start IDE Support [idesupport] --\u003e\n## IDE Support\n\n### PyCharm\n\nGenerally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.\n\n- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)\n\u003c!-- End IDE Support [idesupport] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example\n\n```python\n# Synchronous Example\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis\n\nwith CloudinaryAnalysis(\n    security=cloudinary_analysis.Security(\n        cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n            api_key=\"CLOUDINARY_API_KEY\",\n            api_secret=\"CLOUDINARY_API_SECRET\",\n        ),\n    ),\n) as cloudinary_analysis:\n\n    res = cloudinary_analysis.analyze.ai_vision_general(source={\n        \"uri\": \"https://res.cloudinary.com/demo/image/upload/sample.jpg\",\n    }, notification_url=\"https://path.to/webhook\", prompts=[\n        \"Describe this image in detail\",\n        \"Does this image contain an insect?\",\n    ])\n\n    # Handle response\n    print(res)\n```\n\n\u003c/br\u003e\n\nThe same SDK client can also be used to make asychronous requests by importing asyncio.\n```python\n# Asynchronous Example\nimport asyncio\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis\n\nasync def main():\n    async with CloudinaryAnalysis(\n        security=cloudinary_analysis.Security(\n            cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n                api_key=\"CLOUDINARY_API_KEY\",\n                api_secret=\"CLOUDINARY_API_SECRET\",\n            ),\n        ),\n    ) as cloudinary_analysis:\n\n        res = await cloudinary_analysis.analyze.ai_vision_general_async(source={\n            \"uri\": \"https://res.cloudinary.com/demo/image/upload/sample.jpg\",\n        }, notification_url=\"https://path.to/webhook\", prompts=[\n            \"Describe this image in detail\",\n            \"Does this image contain an insect?\",\n        ])\n\n        # Handle response\n        print(res)\n\nasyncio.run(main())\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Authentication [security] --\u003e\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security schemes globally:\n\n| Name              | Type   | Scheme       | Environment Variable         |\n| ----------------- | ------ | ------------ | ---------------------------- |\n| `cloudinary_auth` | http   | Custom HTTP  | `CLOUDINARY_CLOUDINARY_AUTH` |\n| `o_auth2`         | oauth2 | OAuth2 token | `CLOUDINARY_O_AUTH2`         |\n\nYou can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:\n```python\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis\n\nwith CloudinaryAnalysis(\n    security=cloudinary_analysis.Security(\n        cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n            api_key=\"CLOUDINARY_API_KEY\",\n            api_secret=\"CLOUDINARY_API_SECRET\",\n        ),\n    ),\n) as cloudinary_analysis:\n\n    res = cloudinary_analysis.analyze.ai_vision_general(source={\n        \"uri\": \"https://res.cloudinary.com/demo/image/upload/sample.jpg\",\n    }, notification_url=\"https://path.to/webhook\", prompts=[\n        \"Describe this image in detail\",\n        \"Does this image contain an insect?\",\n    ])\n\n    # Handle response\n    print(res)\n\n```\n\u003c!-- End Authentication [security] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n\u003cdetails open\u003e\n\u003csummary\u003eAvailable methods\u003c/summary\u003e\n\n### [analyze](docs/sdks/analyze/README.md)\n\n* [ai_vision_general](docs/sdks/analyze/README.md#ai_vision_general) - Analyze - AI Vision General\n* [ai_vision_moderation](docs/sdks/analyze/README.md#ai_vision_moderation) - Analyze - AI Vision Moderation\n* [ai_vision_tagging](docs/sdks/analyze/README.md#ai_vision_tagging) - Analyze - AI Vision Tagging\n* [captioning](docs/sdks/analyze/README.md#captioning) - Analyze - Captioning\n* [cld_fashion](docs/sdks/analyze/README.md#cld_fashion) - Analyze - Cld-Fashion\n* [cld_text](docs/sdks/analyze/README.md#cld_text) - Analyze - Cld-Text\n* [coco](docs/sdks/analyze/README.md#coco) - Analyze - Coco\n* [google_logo_detection](docs/sdks/analyze/README.md#google_logo_detection) - Analyze - Google Logo Detection\n* [google_tagging](docs/sdks/analyze/README.md#google_tagging) - Analyze - Google Tagging\n* [human_anatomy](docs/sdks/analyze/README.md#human_anatomy) - Analyze - Human Anatomy\n* [image_quality](docs/sdks/analyze/README.md#image_quality) - Analyze - Image Quality Analysis\n* [lvis](docs/sdks/analyze/README.md#lvis) - Analyze - Lvis\n* [shop_classifier](docs/sdks/analyze/README.md#shop_classifier) - Analyze - Shop Classifier\n* [unidet](docs/sdks/analyze/README.md#unidet) - Analyze - Unidet\n* [watermark_detection](docs/sdks/analyze/README.md#watermark_detection) - Analyze - Watermark Detection\n\n\n### [tasks](docs/sdks/tasks/README.md)\n\n* [get_status](docs/sdks/tasks/README.md#get_status) - Get analysis task status\n\n\u003c/details\u003e\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Retries [retries] --\u003e\n## Retries\n\nSome of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:\n```python\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis\nfrom cloudinary_analysis.utils import BackoffStrategy, RetryConfig\n\nwith CloudinaryAnalysis(\n    security=cloudinary_analysis.Security(\n        cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n            api_key=\"CLOUDINARY_API_KEY\",\n            api_secret=\"CLOUDINARY_API_SECRET\",\n        ),\n    ),\n) as cloudinary_analysis:\n\n    res = cloudinary_analysis.analyze.ai_vision_general(source={\n        \"uri\": \"https://res.cloudinary.com/demo/image/upload/sample.jpg\",\n    }, notification_url=\"https://path.to/webhook\", prompts=[\n        \"Describe this image in detail\",\n        \"Does this image contain an insect?\",\n    ],\n        RetryConfig(\"backoff\", BackoffStrategy(1, 50, 1.1, 100), False))\n\n    # Handle response\n    print(res)\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:\n```python\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis\nfrom cloudinary_analysis.utils import BackoffStrategy, RetryConfig\n\nwith CloudinaryAnalysis(\n    retry_config=RetryConfig(\"backoff\", BackoffStrategy(1, 50, 1.1, 100), False),\n    security=cloudinary_analysis.Security(\n        cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n            api_key=\"CLOUDINARY_API_KEY\",\n            api_secret=\"CLOUDINARY_API_SECRET\",\n        ),\n    ),\n) as cloudinary_analysis:\n\n    res = cloudinary_analysis.analyze.ai_vision_general(source={\n        \"uri\": \"https://res.cloudinary.com/demo/image/upload/sample.jpg\",\n    }, notification_url=\"https://path.to/webhook\", prompts=[\n        \"Describe this image in detail\",\n        \"Does this image contain an insect?\",\n    ])\n\n    # Handle response\n    print(res)\n\n```\n\u003c!-- End Retries [retries] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\nHandling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.\n\nBy default, an API error will raise a models.APIError exception, which has the following properties:\n\n| Property        | Type             | Description           |\n|-----------------|------------------|-----------------------|\n| `.status_code`  | *int*            | The HTTP status code  |\n| `.message`      | *str*            | The error message     |\n| `.raw_response` | *httpx.Response* | The raw HTTP response |\n| `.body`         | *str*            | The response content  |\n\nWhen custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `ai_vision_general_async` method may raise the following exceptions:\n\n| Error Type                 | Status Code        | Content Type     |\n| -------------------------- | ------------------ | ---------------- |\n| models.ErrorResponse       | 400, 401, 403, 404 | application/json |\n| models.RateLimitedResponse | 429                | application/json |\n| models.ErrorResponse       | 500                | application/json |\n| models.APIError            | 4XX, 5XX           | \\*/\\*            |\n\n### Example\n\n```python\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis, models\n\nwith CloudinaryAnalysis(\n    security=cloudinary_analysis.Security(\n        cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n            api_key=\"CLOUDINARY_API_KEY\",\n            api_secret=\"CLOUDINARY_API_SECRET\",\n        ),\n    ),\n) as cloudinary_analysis:\n    res = None\n    try:\n\n        res = cloudinary_analysis.analyze.ai_vision_general(source={\n            \"uri\": \"https://res.cloudinary.com/demo/image/upload/sample.jpg\",\n        }, notification_url=\"https://path.to/webhook\", prompts=[\n            \"Describe this image in detail\",\n            \"Does this image contain an insect?\",\n        ])\n\n        # Handle response\n        print(res)\n\n    except models.ErrorResponse as e:\n        # handle e.data: models.ErrorResponseData\n        raise(e)\n    except models.RateLimitedResponse as e:\n        # handle e.data: models.RateLimitedResponseData\n        raise(e)\n    except models.ErrorResponse as e:\n        # handle e.data: models.ErrorResponseData\n        raise(e)\n    except models.APIError as e:\n        # handle exception\n        raise(e)\n```\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Server Variables\n\nThe default server `https://api.cloudinary.com/v2/analysis/{cloud_name}` contains variables and is set to `https://api.cloudinary.com/v2/analysis/CLOUD_NAME` by default. To override default values, the following parameters are available when initializing the SDK client instance:\n * `cloud_name: str`\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:\n```python\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis\n\nwith CloudinaryAnalysis(\n    server_url=\"https://api.cloudinary.com/v2/analysis/CLOUD_NAME\",\n    security=cloudinary_analysis.Security(\n        cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n            api_key=\"CLOUDINARY_API_KEY\",\n            api_secret=\"CLOUDINARY_API_SECRET\",\n        ),\n    ),\n) as cloudinary_analysis:\n\n    res = cloudinary_analysis.analyze.ai_vision_general(source={\n        \"uri\": \"https://res.cloudinary.com/demo/image/upload/sample.jpg\",\n    }, notification_url=\"https://path.to/webhook\", prompts=[\n        \"Describe this image in detail\",\n        \"Does this image contain an insect?\",\n    ])\n\n    # Handle response\n    print(res)\n\n```\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Custom HTTP Client [http-client] --\u003e\n## Custom HTTP Client\n\nThe Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.\nDepending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.\nThis allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.\n\nFor example, you could specify a header for every request that this sdk makes as follows:\n```python\nfrom cloudinary_analysis import CloudinaryAnalysis\nimport httpx\n\nhttp_client = httpx.Client(headers={\"x-custom-header\": \"someValue\"})\ns = CloudinaryAnalysis(client=http_client)\n```\n\nor you could wrap the client with your own custom logic:\n```python\nfrom cloudinary_analysis import CloudinaryAnalysis\nfrom cloudinary_analysis.httpclient import AsyncHttpClient\nimport httpx\n\nclass CustomClient(AsyncHttpClient):\n    client: AsyncHttpClient\n\n    def __init__(self, client: AsyncHttpClient):\n        self.client = client\n\n    async def send(\n        self,\n        request: httpx.Request,\n        *,\n        stream: bool = False,\n        auth: Union[\n            httpx._types.AuthTypes, httpx._client.UseClientDefault, None\n        ] = httpx.USE_CLIENT_DEFAULT,\n        follow_redirects: Union[\n            bool, httpx._client.UseClientDefault\n        ] = httpx.USE_CLIENT_DEFAULT,\n    ) -\u003e httpx.Response:\n        request.headers[\"Client-Level-Header\"] = \"added by client\"\n\n        return await self.client.send(\n            request, stream=stream, auth=auth, follow_redirects=follow_redirects\n        )\n\n    def build_request(\n        self,\n        method: str,\n        url: httpx._types.URLTypes,\n        *,\n        content: Optional[httpx._types.RequestContent] = None,\n        data: Optional[httpx._types.RequestData] = None,\n        files: Optional[httpx._types.RequestFiles] = None,\n        json: Optional[Any] = None,\n        params: Optional[httpx._types.QueryParamTypes] = None,\n        headers: Optional[httpx._types.HeaderTypes] = None,\n        cookies: Optional[httpx._types.CookieTypes] = None,\n        timeout: Union[\n            httpx._types.TimeoutTypes, httpx._client.UseClientDefault\n        ] = httpx.USE_CLIENT_DEFAULT,\n        extensions: Optional[httpx._types.RequestExtensions] = None,\n    ) -\u003e httpx.Request:\n        return self.client.build_request(\n            method,\n            url,\n            content=content,\n            data=data,\n            files=files,\n            json=json,\n            params=params,\n            headers=headers,\n            cookies=cookies,\n            timeout=timeout,\n            extensions=extensions,\n        )\n\ns = CloudinaryAnalysis(async_client=CustomClient(httpx.AsyncClient()))\n```\n\u003c!-- End Custom HTTP Client [http-client] --\u003e\n\n\u003c!-- Start Resource Management [resource-management] --\u003e\n## Resource Management\n\nThe `CloudinaryAnalysis` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.\n\n[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers\n\n```python\nimport cloudinary_analysis\nfrom cloudinary_analysis import CloudinaryAnalysis\ndef main():\n    with CloudinaryAnalysis(\n        security=cloudinary_analysis.Security(\n            cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n                api_key=\"CLOUDINARY_API_KEY\",\n                api_secret=\"CLOUDINARY_API_SECRET\",\n            ),\n        ),\n    ) as cloudinary_analysis:\n        # Rest of application here...\n\n\n# Or when using async:\nasync def amain():\n    async with CloudinaryAnalysis(\n        security=cloudinary_analysis.Security(\n            cloudinary_auth=cloudinary_analysis.SchemeCloudinaryAuth(\n                api_key=\"CLOUDINARY_API_KEY\",\n                api_secret=\"CLOUDINARY_API_SECRET\",\n            ),\n        ),\n    ) as cloudinary_analysis:\n        # Rest of application here...\n```\n\u003c!-- End Resource Management [resource-management] --\u003e\n\n\u003c!-- Start Debugging [debug] --\u003e\n## Debugging\n\nYou can setup your SDK to emit debug logs for SDK requests and responses.\n\nYou can pass your own logger class directly into your SDK.\n```python\nfrom cloudinary_analysis import CloudinaryAnalysis\nimport logging\n\nlogging.basicConfig(level=logging.DEBUG)\ns = CloudinaryAnalysis(debug_logger=logging.getLogger(\"cloudinary_analysis\"))\n```\n\nYou can also enable a default debug logger by setting an environment variable `CLOUDINARY_DEBUG` to true.\n\u003c!-- End Debugging [debug] --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. \nWe look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. \n\n### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=cloudinary-analysis\u0026utm_campaign=python)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fanalysis-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudinary%2Fanalysis-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fanalysis-python/lists"}