Skip to content

Instantly share code, notes, and snippets.

@matiasfha
Created March 10, 2023 01:26
Show Gist options
  • Save matiasfha/c7cdc5da926d93929e206cc0cc55f06f to your computer and use it in GitHub Desktop.
Save matiasfha/c7cdc5da926d93929e206cc0cc55f06f to your computer and use it in GitHub Desktop.
## 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