-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathutilities.py
More file actions
40 lines (31 loc) · 1.07 KB
/
utilities.py
File metadata and controls
40 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from dotenv import load_dotenv
load_dotenv()
import cloudinary
from cloudinary.utils import cloudinary_url
# get reference to config instance, return "https" URLs by setting secure=True
config = cloudinary.config(secure=True)
print(config.cloud_name)
print(config.api_key)
# Log the configuration
# ==============================
print("**** Set up and configure the SDK:****\n",
config.cloud_name, config.api_key, "\n")
# # To create only a URL
# url, options = cloudinary_url(
# "anteater"
# )
# print("**** Return only the URL --> " + url, "\n")
# To create only a URL (video)
# url, options = cloudinary_url(
# "tortoise",
# resource_type = "video"
# )
# print("**** Return only the URL --> " + url, "\n")
# To create an image tag
# print(cloudinary.CloudinaryImage("puma").image())
# To create an video tag
print(cloudinary.CloudinaryVideo("tortoise").video())
# Build URL using build_url method (image)
# print(cloudinary.CloudinaryImage("puma").build_url())
# Build URL using build_url method (video)
# print(cloudinary.CloudinaryVideo("tortoise").build_url())