Skip to content

A simple utility tool to access s3 object through basic File I/O operations.

License

Notifications You must be signed in to change notification settings

yhori991/py-s3file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
yhori991
May 27, 2019
c49cf81 · May 27, 2019

History

19 Commits
May 27, 2019
May 3, 2019
Mar 27, 2019
Mar 27, 2019
Mar 27, 2019
May 13, 2019
May 13, 2019
May 13, 2019
May 3, 2019
Mar 27, 2019
Mar 27, 2019
Mar 27, 2019

Repository files navigation

s3file

A simple utility tool to access s3 object through basic File I/O operations.

Dependencies

  • boto3

Installation

To install s3file, simply use pipenv:

pipenv install py-s3file

Usage

Basic File I/O operations

Open/Close:

import s3file

fp = s3file.open(path='s3_bucket_name/object_key', mode='r')
content = fp.read()
fp.close()

Read:

import s3file

with s3file.open(path='s3_bucket_name/object_key', mode='r') as fp:
    content = fp.read()

Write:

import s3file

with s3file.open(path='s3_bucket_name/object_key', mode='w') as fp:
    fp.write('some_string_object')

Utility functions

The functions below automatically cache the content on local disk (default: on ~/Downloads/s3file_cache). This allows quick access to the same content for the subsequent function calls.

Load:

import s3file

content = s3file.load(path='path_to_the_s3_object')

Save:

import s3file

s3file.save(path='path_to_the_s3_object', content='content_to_write')

License

MIT

About

A simple utility tool to access s3 object through basic File I/O operations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published