Giter Site home page Giter Site logo

jucheng925 / cld-intro-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudinary-training/cld-intro-python

0.0 0.0 0.0 25.79 MB

Introduction to Cloudinary for API Users and Python Developers

Home Page: https://cloudinary-training.github.io/cld-intro-python/index.html

License: MIT License

Shell 0.23% Python 90.26% HTML 9.51%

cld-intro-python's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.