Skip to main content

Cloudinary Python SDK

Upload, transform, optimize, and manage images and videos with Cloudinary from Python or Django — the cloudinary package on PyPI.

Tests PyPI Downloads License

Install

pip install cloudinary

Quick start

Set your API environment variable (Console > Settings > API Keys):

export CLOUDINARY_URL=cloudinary://<api_key>:<api_secret>@<cloud_name>

Upload an image and get an optimized delivery URL:

import cloudinary
import cloudinary.uploader  # cloudinary.uploader must be imported explicitly

# Configuration is read from CLOUDINARY_URL automatically.


def main():
    # Upload a remote image (a local file path works the same way)
    result = cloudinary.uploader.upload(
        "https://res.cloudinary.com/demo/image/upload/sample.jpg",
        public_id="quickstart-sample",
    )
    print("Uploaded: {0}".format(result["public_id"]))

    # Build a 400x400 auto-cropped URL with automatic format and quality
    url = cloudinary.CloudinaryImage(result["public_id"]).build_url(
        width=400,
        height=400,
        crop="fill",
        gravity="auto",
        fetch_format="auto",
        quality="auto",
        secure=True,
    )
    print("Optimized URL: {0}".format(url))


if __name__ == "__main__":
    try:
        main()
    except Exception as error:
        print("Quick start failed: {0}".format(error))
        print("Check that CLOUDINARY_URL is set (Console > Settings > API Keys).")
        raise SystemExit(1)

Save as quickstart.py and run python quickstart.py. Create a free account if you don't have one — or call cloudinary.provisioning.create_cloud() to provision one without signing up.

Common tasks

Runnable versions live in examples/ — each is a complete file you can run directly.

When to use this SDK

Use this package in Python server-side code, including Django: uploads, signed operations, asset administration, search, moderation, and delivery URL generation.

For other jobs, better-fitting tools exist:

The full capability map — plus the Skills, MCP servers, and CLI worth setting up first — is in cloudinary/docs/platform-capabilities.md.

Status and compatibility

Stable, actively maintained. See CHANGELOG.md.

SDK version Python Django
1.x 3.10 – 3.14 4.2, 5.0, 5.1, 5.2, 6.0

The table lists what CI tests on every commit. Older Python and Django releases are supported on a best-effort basis.

Documentation

Documentation links in this README point at the browsable HTML page, with an (md) companion link that returns the same page as raw Markdown. Inside cloudinary/docs/ and examples/ the links are Markdown-only, since those files are written to be read by coding agents. Either form works for any page: add .md for Markdown, drop it for HTML.

For AI coding agents

  • Contributing to this repo: read AGENTS.md.
  • Using the installed package: the Markdown docs in the installed package's cloudinary/docs/ directory match your installed version and are the source of truth. Locate them with python -c "import cloudinary, pathlib; print(pathlib.Path(cloudinary.__file__).parent / 'docs')", and start with platform-capabilities before assuming a feature exists.

Support

More resources: Cloudinary Academy for courses, code explorers and feature demos, and the Cloudinary roadmap.

Security

See SECURITY.md for private vulnerability reporting. Keep your api_secret in server-side code; for client uploads, use the server-signed pattern in Sign a browser upload.

License

Released under the MIT license — see LICENSE. Copyright (c) Cloudinary Ltd.

Metadata

Release files for cloudinary 1.47.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudinary 1.47.0
File Size Uploaded Provenance Actions
cloudinary-1.47.0.tar.gz 240.9 kB Without provenance Details for cloudinary-1.47.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cloudinary 1.47.0
File Interpreter ABI Platform Actions
cloudinary-1.47.0-py3-none-any.whl Python 3 none any Details for cloudinary-1.47.0-py3-none-any.whl

Total release size: 440.5 kB

Release files / cloudinary-1.47.0.tar.gz

Download URL cloudinary-1.47.0.tar.gz
Size 240.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a42d1312b9b581a68a387ba81b3df7ce35d1870d6ff7bfd9d2777589c247e014
BLAKE2b-256 checksum
How to use checksums
85c945a9e1f0e6cdbba979d7ad86eba731ba62224c6538c5685537058609d971
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

Release files / cloudinary-1.47.0-py3-none-any.whl

Download URL cloudinary-1.47.0-py3-none-any.whl
Size 199.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf14b75d969960ee4dc04125826c12a6ea02a0ecbb75d4bde2ce2e82af0ad010
BLAKE2b-256 checksum
How to use checksums
648a81af3c596570d928c99e4148c5de8f8428163b599a639eeaa1c7b637e4ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

Security for cloudinary 1.47.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.47.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page