Skip to main content

Tiny wrapper for basic S3 functions in boto3

Project description

PyS3

Minimal wrapper for S3 functionality in boto3.

Installation

pip install pys3

Example

from pys3 import PyS3

# Local file
file = PyS3('/path/to/file.txt', 'w')
file.write('Hello World!')
file.close()

# File on S3
file = PyS3('s3://bucket_name/path/to/file.txt', 'w')
file.write('Hello World!')
file.close()

Prerequisites

pys3 uses boto3 as a back-end. Thus, credentials for AWS must be set up according to that framework. For example, place the acces key ID and secret key in the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

How it works

Upon creation of a PyS3 file object, it is checked whether the passed file URL refers to a location on S3. If so, a local copy of the file is downloaded (provided it exists). When the close() method is called, any modifications to the local file are uploaded.

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

pys3-0.0.5.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file pys3-0.0.5.tar.gz.

File metadata

  • Download URL: pys3-0.0.5.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pys3-0.0.5.tar.gz
Algorithm Hash digest
SHA256 90d4e126805644854c3748e7c6f283dc7e522fbfc212b0857edd176c684efd00
MD5 66720cb2552bcf5c4831fe6fd554e05c
BLAKE2b-256 77126a45947c9697509913054f2a166463139fb68a34cd5207635ff5db3809a4

See more details on using hashes here.

Supported by

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