Created
March 10, 2023 01:26
-
-
Save matiasfha/c7cdc5da926d93929e206cc0cc55f06f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Set credentials | |
from dotenv import load_dotenv | |
load_dotenv() | |
import cloudinary | |
import cloudinary.uploader | |
import cloudinary.api | |
import pprint | |
pp = pprint.PrettyPrinter(indent=2) | |
config = cloudinary.config(secure=True) | |
## Upload an image and auto tag it | |
def uploadImage(img_src): | |
hash = cloudinary.uploader.upload(img_src, unique_filename = False, overwrite=True, categorization = "google_tagging", auto_tagging = 0.6) | |
pp.pprint(hash) | |
from sys import argv | |
script, image = argv | |
uploadImage(image) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment