Skip to content

wojtekmach/req_s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReqS3

Req plugin for Amazon S3.

ReqS3 handles a custom s3:// url scheme that supports two endpoints:

s3://<bucket>        # list bucket items
s3://<bucket>/<item> # get item content

Usage

Mix.install([
  {:req, "~> 0.4.0"},
  {:req_s3, "~> 0.1.0"}
])

req = Req.new() |> ReqS3.attach()
Req.get!(req, url: "s3://ossci-datasets").body
#=>
# [
#   "mnist/",
#   "mnist/t10k-images-idx3-ubyte.gz",
#   "mnist/t10k-labels-idx1-ubyte.gz",
#   "mnist/train-images-idx3-ubyte.gz",
#   "mnist/train-labels-idx1-ubyte.gz"
# ]

req = Req.new() |> ReqS3.run()
body = Req.get!(req, url: "s3://ossci-datasets/mnist/train-images-idx3-ubyte.gz").body
<<_::32, n_images::32, n_rows::32, n_cols::32, _body::binary>> = body
{n_images, n_rows, n_cols}
#=> {60_000, 28, 28}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages