Skip to main content

Convenient CLI tool to work with versioned (including Object Lock) S3 buckets (recover, undelete, etc.)

Project description

s3v

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

Installation

# recommended
pipx install s3v

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

Configuration

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

Examples

We upload three versions of same file, each one will overwrite old copy. In "ls" we see filename, last modification time, size of latest copy and number of versions in storage.

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 full target name like s3://stg-objectlock/s3v/test.txt. s3:// prefix is optional ()

List

Now, list contents of s3v logical 'folder' (all objects with name starting with s3v/). If we give full name of object, ls will list all versions.

$ s3v ls stg-objectlock/s3v
Listing objects in bucket 'stg-objectlock' with prefix 's3v'
test.txt                                |2026-02-10 16:21:55|              2|   3|

$ s3v ls stg-objectlock/s3v/test.txt
Listing objects in bucket 'stg-objectlock' with prefix '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 -i VERSION to download specific version.

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

Delete and undelete

s3v rm deletes file. After deletion, aws s3 ls do not list 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/
Listing objects in bucket 'stg-objectlock' with prefix 's3v/'
test.txt                                |2026-02-10 16:35:00|              2|   4| [DEL]

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

 $ s3v ls stg-objectlock/s3v/test.txt
Listing objects in bucket 'stg-objectlock' with prefix 's3v/test.txt'
# Fetching version metadata for bucket: stg-objectlock...
# Fetched metadata for 215 versions from 153 object(s) in bucket 'stg-objectlock'
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/
Listing objects in bucket 'stg-objectlock' with prefix 's3v/'
test.txt                                |2026-02-10 16:35:00|              2|   3|

Restore specific version

To recover specific version of file (make it to be current) use s3v recover (or just s3v r). Let's recover first version of 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

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

s3v-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

s3v-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file s3v-0.1.0.tar.gz.

File metadata

  • Download URL: s3v-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.13.5 HTTPX/0.28.1

File hashes

Hashes for s3v-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2973b9dcb54348d458d26b26ac1238473ace22a55c4ee22924e18953f946748a
MD5 4ac13403c9aaf159d30b7fce68244295
BLAKE2b-256 bead7c7c1305c6d17c97fbdb8a6c08572019aaa402880d1c4209852737ddaedf

See more details on using hashes here.

File details

Details for the file s3v-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: s3v-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.13.5 HTTPX/0.28.1

File hashes

Hashes for s3v-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c6fa9f6c6de5ef53e775cf18a190a8c96490a2fd8ccc4fc510faec5d0946ec6
MD5 85bb3705b8f447471007833cbe161d8f
BLAKE2b-256 14577d2177efc3c5f9621fe45e303da03c218d13cc13f9feb53cda0648ff7518

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