Python library to read S3 file as local file.
Project description
s3-reader
Python library to read S3 file as local file.
Requirement
- Python 3.9, 3.10, 3.11
Installation
$ pip install s3-reader
Usage
from s3_reader import File
def check_s3_file(path):
file = File(path)
with open(file.path) as f:
...
check_s3_file('s3://<bucket>/path/to/file')
In this example, the S3 file is downloaded when file = File(path)
is
executed, and it is stored as a temporary file.
file.path
refers to the path of the locally stored temporary file.
At the end of the check_s3_file
function, the file object is deleted, and
consequently, the temporary file is also deleted.
If path refers to a local file instead of an S3 file, File simply copies the path, and you can use the File object in the same manner.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
s3_reader-0.3.4.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for s3_reader-0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2d1fc97d7206b1dcb002be2db68c5b4f5e6a750fc4893b60b1ef7c7f88a3f7e |
|
MD5 | e8141ef20ba77751d8c12ef8cfc5048b |
|
BLAKE2b-256 | b8c2f0af97c10512ed94b346fbde9578434ae2132988214dd5f1adc06ae189c2 |