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.7.tar.gz (70.4 kB view details)

Uploaded Source

Built Distribution

s3_reader-0.3.7-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file s3_reader-0.3.7.tar.gz.

File metadata

  • Download URL: s3_reader-0.3.7.tar.gz
  • Upload date:
  • Size: 70.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.1

File hashes

Hashes for s3_reader-0.3.7.tar.gz
Algorithm Hash digest
SHA256 b4cd5d76d500a91f93cfce543ffb9c835bea8dbdd24215df1d7c41b226a6f146
MD5 611fddf6d6d22378c0ac095356738554
BLAKE2b-256 54a31ad9f300e658fdfc7e6a5516d722d98247880a88cd3d3228b35f2ece28e1

See more details on using hashes here.

File details

Details for the file s3_reader-0.3.7-py3-none-any.whl.

File metadata

File hashes

Hashes for s3_reader-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d9a9d3413b2877ec95d07c1544cb7e223b7bad871ea14d41965bd886800083e0
MD5 1ead4552ed49c263dc216bf167e065fd
BLAKE2b-256 1cbd267f02b03a75cd194ad27545dbfed6b5259a60e091cb8dfc5616f267cd84

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