Skip to content

Instantly share code, notes, and snippets.

@yuhangch
Created August 14, 2020 02:55
Show Gist options
  • Save yuhangch/78d5b021bca25df18398f20b141e2208 to your computer and use it in GitHub Desktop.
Save yuhangch/78d5b021bca25df18398f20b141e2208 to your computer and use it in GitHub Desktop.
Boto3 use in Minio with Rasterio memoryFIle
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