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.5.tar.gz
(7.9 kB
view details)
Built Distribution
File details
Details for the file s3_reader-0.3.5.tar.gz
.
File metadata
- Download URL: s3_reader-0.3.5.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a998514dff9d5a38401451efe1d296cffd13ce50bcb2f2f31dce646f098ae1e9 |
|
MD5 | 91bf5df39dc5e2345bd82fa8b179f306 |
|
BLAKE2b-256 | 27d70dda4438d9936b337f47be4fe917f5627836b24cd77c3c4cea2b34d56833 |
File details
Details for the file s3_reader-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: s3_reader-0.3.5-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45a1c5bed439a3f1b2ecc47333469b9d78367037655087bb6ae5354989f24f79 |
|
MD5 | 57bbb35c7722ee888bd955542f7783f0 |
|
BLAKE2b-256 | fe07882228f50ffc2fb1a543f0a78da153cf677653b251dcfcf425dec94acb0f |