file-strategies

Strategy classes for access to various file sources (S3, local, etc.). Python 3 compatible.


Keywords
s3, file, aws, s3file, fs, local
License
MIT
Install
pip install file-strategies==1.0.1

Documentation

file-strategies

Build Status Coverage Status

Strategy classes for access to various file sources (S3, local, etc.) under a common interface. Python 3 compatible.

Setup

pip install .

Usage

make_file returns either an S3File or LocalFile object, both of which implement the same interface with functions get_contents and put_contents.

from file_strategies import make_file
  
my_local_or_s3_file = make_file(my_file_path)
my_file_contents = my_local_or_s3_file.get_contents()
my_local_or_s3_file.put_contents('beep boop')