Skip to main content

boto3-s3-cli

PyPI Python versions License

An aws s3-compatible command line, built on the boto3-s3 library. The library is the product and this command is a by-product of it: anyone who just wants the aws s3 command can use aws-cli itself. It can still help where aws-cli is slow to start or too large to install (below).

pip install boto3-s3-cli
boto3-s3 sync ./build s3://my-bucket/build/ --delete

Status: beta (pre-1.0), preparing for 1.0. Python: 3.10+ · License: Apache-2.0

Why use it

  • Fast startup. In a representative Linux measurement, syncing a directory that contained one small file was about 1.7x faster than aws-cli v2.
  • Compact installation. A default dependency-complete installation was about 31.5 MiB, compared with about 268 MiB for the corresponding aws-cli v2 installation. More importantly, in Python and Lambda environments that already have boto3, adding boto3-s3-cli increased the installed package set by only about 2.1 MiB in the measurement below.
  • Easy to add to AWS Lambda. A ZIP-based Python Lambda function can include the package in its deployment ZIP or a Lambda layer. This avoids building or rebuilding a container image solely to add an aws s3-compatible command.

What it is

boto3-s3-cli installs one command, boto3-s3, with every aws s3 subcommand:

cp   ls   mb   mv   presign   rb   rm   sync   website

It takes the aws s3 arguments and global options, reads the same ~/.aws configuration, and does what aws s3 does: the same transfers and sync decisions, and on success the same result lines. Argument handling, resulting S3 state, and exit codes are tested against aws s3. Exit codes carry the meanings aws-cli gives them; the codes a script can branch on are listed in docs/cli/exit-codes.md.

Over the more permissive Python library, this CLI narrows the inputs to what aws s3 accepts and owns argument validation, output, and exit codes. Compatibility is functional rather than full: when something fails, the outcome follows aws s3 (a failed item leaves the others running; a run that cannot proceed stops before it starts). Messages aws's own code writes read the same, apart from the few that aws words wrongly; an error's other details, such as which of two mistakes is reported or the text botocore or Python writes, may differ. Deliberate differences, such as batched deletes and credentials masked in debug output, are listed in docs/cli/aws-differences.md; there is no interactive auto-prompt.

Packaging & startup

boto3-s3-cli is an ordinary Python package: it runs on the selected interpreter and reuses a compatible boto3 / botocore installation rather than bundling its own runtime. In contrast, the official aws-cli v2 installation is a self-contained distribution that bundles its own runtime and dependencies (installed once — it does not unpack itself on every invocation).

For a concrete comparison, the following measurement synced a directory containing one 11 KiB file to an empty prefix of an S3 bucket in the same region, from an m7i.xlarge EC2 instance (Ubuntu 26.04, Python 3.14). Each tool ran as a fresh process 5 times, with a different destination for every run and alternating execution order:

Operation boto3-s3-cli 0.9.0 aws-cli 2.36.40
One-file sync (median) 409 ms 659 ms

The measurement includes SDK setup, remote listing, and the actual upload; the five runs spanned 407-416 ms and 645-663 ms respectively.

Installed package sizes were measured on an x86-64 Linux host with du using Python 3.10 and the same pinned dependency versions, with bytecode caches included:

Installed packages Size
boto3 and its dependencies 29.4 MiB
boto3-s3-cli and all default dependencies 31.5 MiB
Increase when boto3 is already installed 2.1 MiB
aws-cli v2 self-contained installation 268 MiB

The two boto3-s3 project wheels total about 430 KiB compressed. These figures are illustrative rather than guarantees: startup time and size vary with the Python version, platform, filesystem, dependency versions, installation method, and S3 endpoint.

For Python Lambda functions deployed as ZIP archives, install the package and its dependencies into the function archive or a Lambda layer. AWS recommends packaging all function dependencies, including boto3, to avoid runtime dependency version mismatches. Even in that dependency-complete case, the measured package set was about 31.5 MiB.

Install

pip install boto3-s3-cli

Optional extra:

pip install "boto3-s3-cli[crt]"   # AWS Common Runtime transfer engine + CRT checksums

Installing the package also makes a boto3_s3_cli Python package importable, but that is an implementation detail with no API guarantee: the supported interface is the boto3-s3 command. For a Python API, use the boto3-s3 library.

Examples

# Copy (upload / download / S3-to-S3 — the route is inferred from the paths)
boto3-s3 cp ./report.csv s3://my-bucket/report.csv
boto3-s3 cp s3://my-bucket/report.csv ./report.csv
boto3-s3 cp ./build s3://my-bucket/build/ --recursive

# Sync a prefix onto disk, deleting local extras
boto3-s3 sync s3://my-bucket/site/ ./site --delete

# Include / exclude (last match wins)
boto3-s3 cp ./build s3://artifacts/ --recursive --exclude '*' --include '*.tar.gz'

# Preview without touching anything
boto3-s3 sync ./data s3://my-bucket/data/ --dryrun

# List
boto3-s3 ls s3://my-bucket/build/ --recursive --human-readable --summarize

# Delete everything under a prefix
boto3-s3 rm s3://my-bucket/tmp/ --recursive

# Buckets, a presigned URL, a static-site config
boto3-s3 mb s3://my-new-bucket
boto3-s3 presign s3://my-bucket/report.csv --expires-in 900
boto3-s3 website s3://my-bucket --index-document index.html

Streaming works through -, like aws s3 cp: boto3-s3 cp - s3://b/key uploads stdin, and boto3-s3 cp s3://b/key - writes the object to stdout.

Configuration

Credentials and connection settings come from the standard AWS sources, selected with the same global flags as aws s3 — --profile, --region, --endpoint-url (e.g. for MinIO), --no-sign-request, --no-verify-ssl, --ca-bundle, --cli-read-timeout, and --cli-connect-timeout. A global flag may appear before or after the subcommand:

boto3-s3 --profile prod --region eu-west-1 ls s3://my-bucket
boto3-s3 ls s3://my-bucket --profile prod --region eu-west-1

Transfer tuning comes from the profile's [s3] section in ~/.aws/config, read as aws s3 reads it (max_concurrent_requests, multipart_threshold, multipart_chunksize, max_queue_size, max_bandwidth, io_chunksize, preferred_transfer_client, plus the CRT-mode keys target_bandwidth, should_stream, disk_throughput, and direct_io); botocore's own addressing_style, use_accelerate_endpoint, use_dualstack_endpoint and payload_signing_enabled are honored from the same section. One caveat: should_stream, disk_throughput and direct_io are accepted and validated but have no effect, because no released s3transfer takes the file-I/O options that carry them (aws bundles a fork that does).

--debug turns on wire-level logging with credentials (signatures, access-key ids, session tokens) masked by default.

What each key does, how the transfer engine is chosen, and the environment variables read are in configuration.md.

Run boto3-s3 <subcommand> help for a subcommand's full option list.

License

Apache-2.0. See LICENSE in the main repository.

Main project (source, issues): https://github.com/izumo-m/boto3-s3. Report security vulnerabilities privately as described in SECURITY.md, not on the public issue tracker.

Metadata

Release files for boto3-s3-cli 0.11.0

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

Source distribution (sdist)

Source distribution for boto3-s3-cli 0.11.0
File Size Uploaded Provenance Actions
boto3_s3_cli-0.11.0.tar.gz 89.1 kB Without provenance Details for boto3_s3_cli-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for boto3-s3-cli 0.11.0
File Interpreter ABI Platform Actions
boto3_s3_cli-0.11.0-py3-none-any.whl Python 3 none any Details for boto3_s3_cli-0.11.0-py3-none-any.whl

Total release size: 191.0 kB

Release files / boto3_s3_cli-0.11.0.tar.gz

Download URL boto3_s3_cli-0.11.0.tar.gz
Size 89.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7aaf4ce4a3ac7baf2e7f09ef794357c819e019fea37251d74917bb9c1cc1a169
BLAKE2b-256 checksum
How to use checksums
27036577d9026a8d172ade9944b1080d32751e154f92046fb863e4661553428f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / boto3_s3_cli-0.11.0-py3-none-any.whl

Download URL boto3_s3_cli-0.11.0-py3-none-any.whl
Size 101.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50ca321dde27850400ba40629a56fb42a0833b575c3336cfc28864704c57f9c8
BLAKE2b-256 checksum
How to use checksums
dd1381e0c4a8c58d3bb3c0ec867096a3c01594820fb83aee8d8e5bd288179a98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for boto3-s3-cli 0.11.0

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.

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