Skip to main content

Allows head or tail of a file on s3 without downloading the whole file

Project description

mous3

A python utility that allows you to print a number of bites from either the beginning or end of an object stored on AWS S3 without downloading the entire file.

Features

  • AWS Profile Support: Optionally specify an AWS profile to use for accessing the S3 bucket, making it easier to work with multiple AWS accounts or configurations.

  • Flexible Byte Range: Customize the number of bytes you want to read from the end of the object.

Requirements

  • Python 3.6+
  • Boto3

Installation

  • pip install mous3

  • Your AWS credentials will need to be stored in ~/.aws/credentials or set as environment variables (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY).

Usage

mous3 [-h] [--bytes BYTES] [--profile PROFILE] {direction} {bucket_name} {key}

Positional arguments:

direction The direction to read from the object. Can be "head" or "tail".

bucket_name The name of the S3 bucket.

key The key of the object in the S3 bucket.

Optional arguments:

-h, --help show this help message and exit

--bytes BYTES Number of bytes to download. Default is 1000. You do not need to specify positive or negative, as this is determined by the "direction" argument.

--profile PROFILE The AWS profile to use. Optional.

Examples:

  • To print the first 1000 bytes (head) of an object using the AWS profile named myProfile:
    • mous3 head my-bucket example.log --profile myProfile
  • To print the last 1000 bytes (tail) of an object named example.log in the bucket my-bucket:
    • mous3 tail my-bucket example.log
  • To print the last 200 bytes of the object:
    • mous3 tail my-bucket example.log --bytes 200

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

mous3-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

mous3-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mous3-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for mous3-0.1.0.tar.gz
Algorithm Hash digest
SHA256 73cda21bd394940b96bb10c13eef795ad094a78b6039449c0921eb6735860777
MD5 d1a4992486f8a6efc6c85ad659e40e42
BLAKE2b-256 fe330f20c506fc0f42692c6472141a84a2a5cc032d77582b21215ff645f068b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mous3-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for mous3-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00af890f22244b17c98a9b1d02127c2296a77462dd12bdd233ffe4936adeb468
MD5 4e6b62a42c6c2da7f2346fb8bcaed6e5
BLAKE2b-256 b8747bc8e72bcd1dc8a6dbccfeccb09e56365dd60cd39fb44554f3bf4880efcb

See more details on using hashes here.

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