Skip to main content

s3psync: A simple tool to sync files and directories to Amazon S3.

Project description

S3 Parallel Sync

Dependency Review Python package PyPI

This script is used to sync files and folders to an S3 bucket in parallel, leveraging the aws s3 sync command. The aws s3 sync command supports multipart uploads and can utilize up to 10 threads, making it particularly useful when you have a large number of large files to upload. This script allows you to specify the number of parallel instances of aws s3 sync to use.

Requirements

  • Python 3.10 or higher (includes pip)
  • AWS CLI
  • AWS profile with the necessary permissions to perform S3 uploads (see here for more information on how to set up AWS profiles)

Usage

To install the tool, run the following command:

python -m pip install --upgrade pip wheel
python -m pip install --upgrade s3psync

To sync files and folders to an S3 bucket in parallel, run the following command:

s3psync --help
Usage: s3psync [OPTIONS]

Options:
  --version
  --aws-profile TEXT            AWS profile name  [required]
  --parent-dir TEXT             Parent directory to sync  [required]
  --s3-bucket TEXT              S3 bucket to sync to  [required]
  --parallel-instances INTEGER  Number of parallel instances for aws s3 sync,
                                default is 1
  --help                        Show this message and exit.

Here is an example of how to use the tool:

s3psync \
  --aws-profile tmpuser_for_data_upload \
  --s3-bucket premtests1232 \
  --parent-dir "/path/to/testdir" \
  --parallel-instances 30

Note that you need to have the necessary AWS permissions to perform S3 uploads. The tool will use the AWS CLI to perform the upload, so you need to have the AWS CLI installed and configured with the appropriate credentials. You can use the --aws-profile option to specify the AWS profile to use.

Development

Dev tools

  • Make utility (Make for Windows, Make for Linux and Mac is usually pre-installed)

Set up the environment using the provided Makefile. Follow these steps:

  1. Ensure you have make installed on your system. You can check this by running make --version in your terminal. Install or update make if needed.
  2. Install the necessary dependencies by running make install or make all.
  3. Create a Python virtual environment by running python3 -m venv --prompt s3psync venv. Activate it by running source venv/bin/activate.
  4. Verify the installation by running s3psync --version. If the tool is installed correctly, it should display the version number.
  5. Run the tool for example by running python -m s3psync --help.
  6. Exit the virtual environment by running deactivate.

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

s3psync-0.0.6.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

s3psync-0.0.6-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file s3psync-0.0.6.tar.gz.

File metadata

  • Download URL: s3psync-0.0.6.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for s3psync-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c4b17471b84dc86d1a4c9d8aa8aae4d6af99037e7b57f1e0a0547cb3728a7c61
MD5 0aff8813380c5d0b7a9be606b44caf6e
BLAKE2b-256 4a845c84df511e23390d6a71fce228509439a1aa08fbef0885e80f8b00797d47

See more details on using hashes here.

File details

Details for the file s3psync-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: s3psync-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for s3psync-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a317220410a2edcfb183247cfb5e3dd4d9aea860c3cbde0222529dc45f493f7c
MD5 43d64e6f9c3cd0f9b56e93d1b66a2ae7
BLAKE2b-256 7073377e99c12c3cea1dcdb6e024f9d9647ce0f7067bd0a9b690505b232ce21e

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