Skip to main content

aws-s3-share

PyPI - Version PyPI - Python Version PyPI - License

A command-line tool for compressing files or directories, uploading them to Amazon S3, then generating a pre-signed URL for easy sharing. This is useful for example for uploading/downloading files from EC2 instances without direct connexion to the Internet.

Compressed archives are uploaded with a random 12-characters long prefix to avoid overwriting of files of the same name.

Features

  • Compression: .gz for files, tar.gz for directories
  • Multipart S3 Upload: Efficient uploads to Amazon S3
  • Pre-signed URLs: Generate pre-signed URLs with configurable expiry
  • Progress Tracking: Progress bars for compression and upload
  • AWS Profile Support: Use AWS profiles for authentication
  • OS Independent: Works on Linux, macOS, and Windows

Installation

uvx aws-s3-share

Using pipx

pipx install aws-s3-share

Using pip

pip install aws-s3-share

Quick Start

Basic Usage

# Upload a file
aws-s3-share --bucket my-bucket myfile.txt

# Upload a directory
aws-s3-share --bucket my-bucket mydirectory/

# Specify expiry time (in seconds)
aws-s3-share  --bucket my-bucket --expiry 7200 myfile.txt

# Specify an AWS profile
aws-s3-share --bucket my-bucket --profile myprofile myfile.txt

Configuration

aws-s3-share supports command-line arguments and reading its options from a configuration file (~/.config/aws-s3-share.toml on Linux/macOS, %AppData%\Roaming\aws-s3-share.toml on Windows). Valid configuration file options are bucket, expiry, and profile.

Options are applied in this order of precedence:

  1. Command-line arguments (highest priority)
  2. Configuration file options
  3. Default values (lowest priority, expiry only)

Command-line Options

aws-s3-share [OPTIONS] PATH

Options:
  -b, --bucket TEXT     S3 bucket to upload to
  -e, --expiry INTEGER  Pre-signed URL expiry time in seconds (default: 3600)
  -p, --profile TEXT    AWS profile name to use for authentication
  -h, --help           Show this message and exit
  --version            Show the version and exit

AWS Credentials

If neither the command-line argument --profile nor the configuration file option profile is provided, aws-s3-share uses the standard AWS credential chain:

  1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  2. AWS credentials file (~/.aws/credentials)
  3. IAM roles (when running on EC2)

Required IAM Permissions

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl",
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::your-bucket-name/*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:CreateMultipartUpload",
                "s3:CompleteMultipartUpload",
                "s3:AbortMultipartUpload",
                "s3:ListMultipartUploads",
                "s3:ListParts"
            ],
            "Resource": "arn:aws:s3:::your-bucket-name/*"
        }
    ]
}

Metadata

Release files for aws-s3-share 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-s3-share 0.1.3
File Size Uploaded Provenance Actions
aws_s3_share-0.1.3.tar.gz 17.2 kB Without provenance Details for aws_s3_share-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-s3-share 0.1.3
File Interpreter ABI Platform Actions
aws_s3_share-0.1.3-py3-none-any.whl Python 3 none any Details for aws_s3_share-0.1.3-py3-none-any.whl

Total release size: 37.5 kB

Release files / aws_s3_share-0.1.3.tar.gz

Download URL aws_s3_share-0.1.3.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2fc0287c2cb539af606419d3fa7a1d690d9e0a886f41a97b4d8300117d73b880
BLAKE2b-256 checksum
How to use checksums
7d2d93d0ca62aa2c02f03454c6597f9fd19817ef533481638084ffa9cc507bfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / aws_s3_share-0.1.3-py3-none-any.whl

Download URL aws_s3_share-0.1.3-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9c7e987f7a646d5c11f3ac6294669b9424ba9977f24d6624ce94f69d5c19ea4
BLAKE2b-256 checksum
How to use checksums
905a091f0b76934ea16ed8d7f7ba1f315258c6a1b69f5922e163e06aa84c4b85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Security for aws-s3-share 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page