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

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for s3_reader-0.3.6.tar.gz
Algorithm Hash digest
SHA256 1317322f5352c38933d604550401e6c6fc28308f49af1e165172d9bd452d80c8
MD5 3fd2281b1182cbd130e7179fc5ac51aa
BLAKE2b-256 cd1ac97e9d1ea7d613883c5abe2ba524e6a073c2c42f9a0952d9825fee50980d

See more details on using hashes here.

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

Hashes for s3_reader-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b518bf31ddeb229df457dee977e2e922e9ea98d20de1ccf7f10fd7e5cd1329c8
MD5 5393fd653c25af8d18578ad0a4f838b2
BLAKE2b-256 74a7d31ad1abd620f6c4cb70b6121f34fadbdc243b159926728b6dd0491a2898

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