Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list all items in digital ocean spaces

import boto3
from botocore.client import Config

# Initialize a session using DigitalOcean Spaces.
session = boto3.session.Session()
client = session.client('s3',
                        region_name='fra1',
                        endpoint_url='https://fra1.digitaloceanspaces.com',
                        aws_access_key_id= ACCESS_KEY_ID,
                        aws_secret_access_key=SECRET_ACCESS_KEY)

# List all buckets on your account.
response = client.list_buckets()
spaces = [space['Name'] for space in response['Buckets']]
print("Spaces List: %s" % spaces)

# Print all items in a bucket
response = client.list_objects(Bucket='bucket-name')
for obj in response['Contents']:
    print(obj['Key'])
Comment

PREVIOUS NEXT
Code Example
Python :: pyqt fixed window size 
Python :: kill os system by pid python script 
Python :: analyser.polarity_scores get only compound 
Python :: fuiyoh 
Python :: Fifth step Creating Advance app in python django 
Python :: python import local file 
Python :: pubmed database python 
Python :: pythoon 
Python :: nltk python text from url 
Python :: daemon in os 
Python :: tz convert python 
Python :: init matrix in numpy 
Python :: sqlite3.operationalerror no such column version 
Python :: docs in python parameter 
Python :: gridTraveler python 
Python :: "%(class)s" in django 
Python :: add legend to px.choropleth map python 
Python :: python remove title from name 
Python :: convert dictionary to 2d array python 
Python :: geopandas change dtype of a columns 
Python :: jama python rest api 
Python :: comprehension list iloc pandas 
Python :: python default parameters depend on other paramters 
Python :: paramhans ramchandra das 
Python :: response object has no code 
Python :: save file in windows hidden folder python 
Python :: fibonacci program in python 
Python :: BusyIndicator Import 
Python :: how to execute queries with cxoracle python 
Python :: trace table python 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =