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.6.tar.gz
(7.9 kB
view details)
Built Distribution
File details
Details for the file s3_reader-0.3.6.tar.gz
.
File metadata
- Download URL: s3_reader-0.3.6.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 | 1317322f5352c38933d604550401e6c6fc28308f49af1e165172d9bd452d80c8 |
|
MD5 | 3fd2281b1182cbd130e7179fc5ac51aa |
|
BLAKE2b-256 | cd1ac97e9d1ea7d613883c5abe2ba524e6a073c2c42f9a0952d9825fee50980d |
File details
Details for the file s3_reader-0.3.6-py3-none-any.whl
.
File metadata
- Download URL: s3_reader-0.3.6-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 | b518bf31ddeb229df457dee977e2e922e9ea98d20de1ccf7f10fd7e5cd1329c8 |
|
MD5 | 5393fd653c25af8d18578ad0a4f838b2 |
|
BLAKE2b-256 | 74a7d31ad1abd620f6c4cb70b6121f34fadbdc243b159926728b6dd0491a2898 |