Skip to main content

Python module to upload objects to an S3 bucket.

Project description

Versions Supported

Python

Language Stats

Language count Code coverage

Repo Stats

GitHub GitHub repo size GitHub code size

Activity

GitHub Repo created GitHub commit activity GitHub last commit

Build Status

pypi-publish pages-build-deployment

PyS3Uploader

Python module to upload an entire directory to an S3 bucket.

Installation

pip install PyS3Uploader

Usage

Upload objects in parallel
import s3

if __name__ == '__main__':
    wrapper = s3.Uploader(
        bucket_name="BUCKET_NAME",
        upload_dir="FULL_PATH_TO_UPLOAD",
        exclude_path="PART_OF_UPLOAD_DIR_TO_EXCLUDE"
    )
    wrapper.run_in_parallel()
Upload objects in sequence
import s3

if __name__ == '__main__':
    wrapper = s3.Uploader(
        bucket_name="BUCKET_NAME",
        upload_dir="FULL_PATH_TO_UPLOAD",
        exclude_path="PART_OF_UPLOAD_DIR_TO_EXCLUDE"
    )
    wrapper.run()

Mandatory arg

  • bucket_name - Name of the s3 bucket.
  • upload_dir - Directory to upload.

Optional kwargs

  • s3_prefix - S3 object prefix for each file. Defaults to None
  • exclude_path - Path in upload_dir that has to be excluded in object keys. Defaults to None
  • skip_dot_files - Boolean flag to skip dot files. Defaults to True
  • overwrite - Boolean flag to overwrite files present in S3. Defaults to False
  • logger - Bring your own custom pre-configured logger. Defaults to on-screen logging.

  • region_name - AWS region name. Defaults to the env var AWS_DEFAULT_REGION
  • profile_name - AWS profile name. Defaults to the env var PROFILE_NAME
  • aws_access_key_id - AWS access key ID. Defaults to the env var AWS_ACCESS_KEY_ID
  • aws_secret_access_key - AWS secret access key. Defaults to the env var AWS_SECRET_ACCESS_KEY

AWS values are loaded from env vars or the default config at ~/.aws/config / ~/.aws/credentials

Coding Standards

Docstring format: Google
Styling conventions: PEP 8
Clean code with pre-commit hooks: flake8 and isort

Release Notes

Requirement

python -m pip install gitverse

Usage

gitverse-release reverse -f release_notes.rst -t 'Release Notes'

Linting

pre-commit will ensure linting, run pytest, generate runbook & release notes, and validate hyperlinks in ALL markdown files (including Wiki pages)

Requirement

pip install sphinx==5.1.1 pre-commit recommonmark

Usage

pre-commit run --all-files

Pypi Package

pypi-module

https://pypi.org/project/PyS3Uploader/

Runbook

made-with-sphinx-doc

https://thevickypedia.github.io/PyS3Uploader/

License & copyright

© Vignesh Rao

Licensed under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pys3uploader-0.2.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file pys3uploader-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pys3uploader-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for pys3uploader-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77cd044518b14f0eaf219d08aa4ec403901d18a1ce42b81a54f03cec013fe933
MD5 64bb23ecfab81db27f658d2e3eec8c6e
BLAKE2b-256 e5e976ed48a170df71f34bd99aa6ed0d608ba52e40c6131dffdcd523f6df2532

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