Skip to main content

Python library to read S3 file as local file.

Project description

s3-reader

test test coverage

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


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)

Uploaded Source

Built Distribution

s3_reader-0.3.5-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for s3_reader-0.3.5.tar.gz
Algorithm Hash digest
SHA256 a998514dff9d5a38401451efe1d296cffd13ce50bcb2f2f31dce646f098ae1e9
MD5 91bf5df39dc5e2345bd82fa8b179f306
BLAKE2b-256 27d70dda4438d9936b337f47be4fe917f5627836b24cd77c3c4cea2b34d56833

See more details on using hashes here.

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

Hashes for s3_reader-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 45a1c5bed439a3f1b2ecc47333469b9d78367037655087bb6ae5354989f24f79
MD5 57bbb35c7722ee888bd955542f7783f0
BLAKE2b-256 fe07882228f50ffc2fb1a543f0a78da153cf677653b251dcfcf425dec94acb0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page