Skip to main content

s3v

Convenient CLI tool to work with versioned S3 buckets. Like aws s3 or aws s3api but much easier to use.

s3v is like if aws s3 and aws s3api were built on our planet — for actual humans.

Installation

# recommended
pipx install s3v

# or from git
pipx install git+https://github.com/yaroslaff/s3v

Configuration

s3v uses boto3, so configuration is the same as for aws utility (same ~/.aws/ files or AWS_ shell variables, and optional --profile NAME argument)

Examples

We upload three versions of the same file, each one will overwrite old copy.

Upload

$ echo 1 > test.txt 
$ s3v cp test.txt s3://stg-objectlock/s3v/
$ echo 2 > test.txt 
$ s3v cp test.txt s3://stg-objectlock/s3v/
$ echo 3 > test.txt 
$ s3v cp test.txt s3://stg-objectlock/s3v/

You can also give the full target name like s3://stg-objectlock/s3v/test.txt. s3:// prefix is optional (s3v will try to guess what is local file and what is bucket name).

List

Now, let's list the contents of the s3v logical 'folder' (all objects with name starting with s3v/). In "ls" we see filename, last modification time (UTC), size of latest copy and number of versions in storage. If we give full name of object, ls will list all versions of this object.

$ s3v ls stg-objectlock/s3v
test.txt                                |2026-02-10 16:21:55|              2|   3|

$ s3v ls stg-objectlock/s3v/test.txt
Objects under prefix 's3v/test.txt':
s3v/test.txt
   by0fQCa9Jl7gFgl8vKEjaDvl8z3CSRnD          2  2026-02-10 16:21:30
   LHK6nA8Ny5YHNh7TOoH94LDinqCH9Czt          2  2026-02-10 16:21:46
   iIGXCsBmEKvBq7DhaP09DIzp3fLO9d1H          2  2026-02-10 16:21:55

Downloading

s3v cp will download latest version of file.

$ s3v cp stg-objectlock/s3v/test.txt .

$ cat test.txt 
3

Give -s VERSION to download specific version.

$ s3v cp stg-objectlock/s3v/test.txt . -s by0fQCa9Jl7gFgl8vKEjaDvl8z3CSRnD
  Using version: by0fQCa9Jl7gFgl8vKEjaDvl8z3CSRnD
$ cat test.txt 
1

You can use human language for -s, it understands words: first (oldest), latest, (last, newest), previous (prev, p). Numerical index where 0 is oldest copy, 1 is next one and so on. Negative numbers are counted from latest, e.g. -1 is latest copy, -2 is a little older and so on. You can give time specification (we use dateparser) so it understands "yesterday", "2 weeks ago" or "2026-02-10 16:22" or "16:22". If a time specification is given, s3v will download the version which was current on that time (latest uploaded before this time).

$ s3v cp stg-objectlock/s3v/test.txt . -s 'midnight'
# Downloading s3://stg-objectlock/s3v/test.txt >>> test.txt...
# will use version from 2026-02-10 17:22:31+00:00 which is the latest version older than specified time 2026-02-11 00:00:00+00:00
  Using version: EouOCDXQpn6xvA9LOXhlB6JITw_DZj_0
# Successfully downloaded (2) to test.txt

Delete and undelete

s3v rm deletes file. After deletion, aws s3 ls does not list the file, but s3v ls still shows it with [DEL] tag.

$ s3v rm stg-objectlock/s3v/test.txt
$ aws s3 ls stg-objectlock/s3v/
$ s3v ls stg-objectlock/s3v/
test.txt                                |2026-02-10 16:35:00|              2|   4| [DEL]

When viewing versions for a file, we will see a special delete marker on S3 (which makes file to be logically 'deleted').

$ s3v ls stg-objectlock/s3v/test.txt
Objects under prefix 's3v/test.txt':
s3v/test.txt [deleted]
   by0fQCa9Jl7gFgl8vKEjaDvl8z3CSRnD          2  2026-02-10 16:21:30
   LHK6nA8Ny5YHNh7TOoH94LDinqCH9Czt          2  2026-02-10 16:21:46
   iIGXCsBmEKvBq7DhaP09DIzp3fLO9d1H          2  2026-02-10 16:21:55
   odaXkvFlMoAWwDu_q.K3esuYdHjUpgMg  [DELETED]  2026-02-10 16:40:33

s3v unrm will remove "delete marker" and file (latest version) will be available again.

$ s3v unrm stg-objectlock/s3v/test.txt

$ s3v ls stg-objectlock/s3v/
test.txt                                |2026-02-10 16:35:00|              2|   3|

s3v wipe will delete ALL VERSIONS of speficied object.

$ s3v wipe s3://stg-objectlock/test_file_1770544464743.txt
# Wiping s3://stg-objectlock/test_file_1770544464743.txt (deleting all versions and delete markers)...
# Successfully wiped s3://stg-objectlock/test_file_1770544464743.txt from history (deleted 2 versions/delete markers)

Restore specific version

To recover specific version of file (make it to be current) use s3v recover (or just s3v r). Let's recover the first version of the file.

$ s3v recover stg-objectlock/s3v/test.txt . -s by0fQCa9Jl7gFgl8vKEjaDvl8z3CSRnD
Successfully recovered version by0fQCa9Jl7gFgl8vKEjaDvl8z3CSRnD as current version of s3://stg-objectlock/s3v/test.txt

$ s3v cp stg-objectlock/s3v/test.txt . 
$ cat test.txt 
1

Metadata

Release files for s3v 0.1.8

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

Source distribution (sdist)

Source distribution for s3v 0.1.8
File Size Uploaded Provenance
s3v-0.1.8.tar.gz 12.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for s3v 0.1.8
File Interpreter ABI Platform
s3v-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 26.4 kB

Release files / s3v-0.1.8.tar.gz

Download URL s3v-0.1.8.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9caaf07c6177878ef41ac8e2e2ed075343ccd1925caddda327a691c5b0ef783f
BLAKE2b-256 checksum
How to use checksums
f5d4b572b915dac50024553cbc8246101532ce7825d861d27147298a451c7dc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.13.5 HTTPX/0.28.1

Release files / s3v-0.1.8-py3-none-any.whl

Download URL s3v-0.1.8-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
162b456db18de22e1cc23bc135a3fd62cf2726c29afc1db735b4d875807b172b
BLAKE2b-256 checksum
How to use checksums
95c10d5d967419e572d6b58e1962b5ffaaf2b06404f5820cc42a439730260dcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.13.5 HTTPX/0.28.1

Security for s3v 0.1.8

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.

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