Created
August 14, 2020 02:55
-
-
Save yuhangch/78d5b021bca25df18398f20b141e2208 to your computer and use it in GitHub Desktop.
Boto3 use in Minio with Rasterio memoryFIle
This file contains hidden or 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
import boto3 | |
from botocore.client import Config | |
from rasterio.io import MemoryFile | |
session = boto3.session.Session() | |
client = session.client( | |
service_name="s3", | |
endpoint_url="http://localhost:9000", | |
aws_access_key_id='KEY', | |
aws_secret_access_key="SECRET" | |
) | |
with MemoryFile(data) as memfile: | |
client.upload_fileobj(memfile,"bucket","key") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment