roto.s3

Access and Orchestrate Amazon Simple Storage Service

Description

This is a 'reticulated' wrapper for the 'Python' 'boto3' 'AWS' 'S3' client library https://boto3.readthedocs.io/en/latest/reference/services/s3.html. It requires 'Python' version 3.5+ and an 'AWS' account.

What's Inside The Tin

The following functions are implemented: (more to come)

Installation

devtools::install_github("hrbrmstr/roto.s3")
# OR
devtools::install_git("git://gitlab.com/hrbrmstr/roto.s3")
options(width=120)

Usage

library(roto.s3)
library(tidyverse)

# current verison
packageVersion("roto.s3")
suppressMessages(suppressWarnings(unlink("/tmp/mtcars.csv", force=TRUE)))
suppressMessages(suppressWarnings(unlink("/tmp/mtcars-01.csv", force=TRUE)))

Upload

write_csv(mtcars, "/tmp/mtcars.csv")

upload_file(
  filename = "/tmp/mtcars.csv", 
  bucket = "is.rud.test", 
  key = "mtcars.csv",
  profile_name = "personal"
)

file_exists(
  bucket = "is.rud.test", 
  key = "mtcars.csv", 
  profile_name = "personal"
)

Download

download_file(
  bucket = "is.rud.test", 
  key = "mtcars.csv", 
  filename = "/tmp/mtcars-again.csv", 
  profile_name = "personal"
)

read_csv("/tmp/mtcars-again.csv")


hrbrmstr/roto.s3 documentation built on May 29, 2019, 11:42 a.m.