Skip to main content

Pulls (filtered) files from S3 and adds them to a tar archive.

Project description

s3tar

Pulls (filtered) files from S3 and adds them to a tar archive.

Creates the command line script star.

$ star --help
Usage: star [OPTIONS] PATH

  Generates a tar archive of S3 files.

  Files are selected by a path made up of 'bucket/prefix' and optionaly by a
  time-based filter.

  'profile' is the AWS CLI profile to use for accessing S3.  If you use
  chaim or cca then this is the alias name for the account.

  The time based filter relies on the files being named with ISO Formatted
  dates and times embedded in the file names.  i.e.
  'file.2020-03-04T12:32:21.txt' The regular expression used is:

      /.*[._-]{1}([0-9-]{10}T[0-9:]{8}).*/

  The 'start' and 'end' parameters can either be ISO formatted date strings
  or unix timestamps.  If only the date portion of the date/time string is
  given the time defaults to midnight of that day.

  The length parameter is a string of the form '3h', '2d', '1w' for,
  respectively 3 hours, 2 days or 1 week.  Only hours, days or weeks are
  supported.  The 'length' and 'end' parameters are mutually exclusive, give
  one or the other, not both.

  If neither the 'end' nor the 'length' parameter is given, the end time
  defaults to 'now'.

  If the 'start' parameter is not given no filtering of the files is
  performed, and all files found down the path are copied across to the tar
  archive recursively.

Options:
  -e, --end TEXT      optional end time
  -l, --length TEXT   optional time length (i.e. 1d, 3h, 4w)
  -p, --profile TEXT  AWS CLI profile to use (chaim alias)
  -s, --start TEXT    optional start time
  --help              Show this message and exit.

Install

The script is python3 only (>=python3.6).

Install it under your python3 user directories with:

python3 -m pip install s3tar --user

If this is the first python3 user script you have you will have to adjust your path. The script location will be $HOME/.local/bin on a Linux machine, so add that to you path in your shell init file e.g.

echo "export PATH=$HOME/.local/bin:$PATH" >>~/.bashrc

If your shell is bash.

To check that installed ok:

star --help

Should display the help text.

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

s3tar-1.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

s3tar-1.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file s3tar-1.0.1.tar.gz.

File metadata

  • Download URL: s3tar-1.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.5.13-1-MANJARO

File hashes

Hashes for s3tar-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f2b29e20342aafdfd781e61e57887082e23f17c0d9c055e642d692e3bf65447d
MD5 6ae8b14afa5ce3ada257b79d9f9a97d8
BLAKE2b-256 2c181a7fe46c6c32d1d62d3c566347dac08cd42172772d5785450c30cad64be6

See more details on using hashes here.

Provenance

File details

Details for the file s3tar-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: s3tar-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.5.13-1-MANJARO

File hashes

Hashes for s3tar-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6d74cb83217f998f8f2917ef4c71cb3ec81bef248f1dfc53b50dd0159252cb4
MD5 8b5ba9c62acf65c704c932c6095bed9d
BLAKE2b-256 d1b0110aca71576c1975699604b2497b62e22eda916b55106a7c60a0934fb01e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page