Skip to content

Repository files navigation

Introduction to Cloudinary Using Python

Environment Setup

Install Python3 and Pip

You will need to install Python on your machine, version 3.8 or higher.

Important - Installing Python will also install pip, the package manager for Python.

Mac

Install Python3 and Pip3 on Mac Using Brew

Install Python on Mac - 3.11.0 is here!

Windows

Install Python on Windows

Mac Users

Using Homebrew:

brew install python3

Verify Python install

# verify versions
$ python3 --version
Python 3.10.8 #Python 3.8 or above is ideal!

$ pip3 --version
pip 22.3

Choose an IDE or Use Text Editor

Download Repository

Introduction to Cloudinary for API Users and Python Developers

  • Assets are located in /assets directory
  • Run code from root directory

Credentials

  1. Create a free account on Cloudinary at cloudinary.com/signup

  2. Navigate to the Dashboard. Copy your CLOUDINARY_URL into your clipboard.

Dashboard

  • Key: CLOUDINARY_URL
  • Value: cloudinary://API_KEY:API_SECRET@CLOUD_NAME
  1. Create a .env file in the root of the project. Paste your CLOUDINARY_URL environment variable into your .env file. OR, you can use the env.example file we've created for you, which already exists in this repository. You can paste in your CLOUDINARY_URL where there is currently a placeholder for you which looks like this:
CLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAME

We store credentials in a .env file (or a .env.sample file!), but this isn't the only way.

3 ways for credentials

Use Pip3 to Install Cloudinary and dotenv

Get the latest Pip

pip3 install --upgrade pip

Install Cloudinary

pip3 install cloudinary

Install dotenv

pip3 install python-dotenv 

In python script

from dotenv import load_dotenv
import os 

load_dotenv()

Run Code: Test Credentials

Make sure to npm install the Python libraries. You will be using the cloudinary and the dotenv libraries.

python3 test_config.py

You should see your Cloud Name and API Key output in this format:

****Set up and configure the SDK:****
 cloud_name | api_key 

PS- Always keep your API_Secret private!

Run Code

python3 upload.py

Credits

assets/images

anteater.jpg - Photo by Sean P. Twomey from Pexels

glacier.mp4 - Photo by Jan Zakelj from Pexels

iguana.jpg - Photo by Simon Berger from Pexels

puma.jpg - Photo by Pixabay from Pexels

llama.jpg - Photo by Jen Brissman, Machu Picchu, Cusco, Peru

sealion.jpg - Photo by Jen Brissman, San Cristobal Island, Galapagos

tortoise.mp4 - Photo by Jen Brissman, Santa Cruz Island, Galapagos

y2kbug.ttf - Public TrueType Font File, Y2K Bug, from All-free-download.com

About

Introduction to Cloudinary for API Users and Python Developers

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages