<commit_before>This utility allows you to take samples from an Amazon S3 key.

What it does is grab random bytes from the key and assemble unbroken lines from
the file to create as sample.

The use case is for determining a file format, file contents, etc. See the
cognoscenti project for an example.

_Usage:_

    ./sample.py s3://bucket/key.csv [LINES]

LINES allows you to indicate the number of lines you hope to recieve. It will
grab 1000 lines by default.

You can also attempt to grab the header row of the file.

    ./sample.py s3://bucket/key.csv --headers [LINES]<commit_msg>Update README.<commit_after>This utility allows you to take samples from an Amazon S3 key.

What it does is grab random bytes from the key and assemble unbroken lines from
the file to create as sample.

The use case is for determining a file format, file contents, etc. See the
cognoscenti project for an example.

_Usage: sample.py [OPTIONS]_

    Options:
      --bucket TEXT             bucket name
      --key TEXT                key name
      --headers / --no-headers  Include headers in output, defaults to include.
      -d, --delimiter TEXT      File delimiter, defaults to ,
      -l, --lines INTEGER       How many sample lines do you want? Defaults to 1000.
      --help                    Show this message and exit.

Allows you to indicate the number of lines you hope to recieve. It will
grab 1000 lines by default.

#### Example

  python sample.py --bucket foo --key path/to/bar.csv > sample_file.csv
{'fraction_non_alphanumeric': 0.061835106382978726, 'fraction_numerical': 0.010638297872340425, 'mean_word_length': 2.7160493827160495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4241999', 'n_tokens_mistral': 426, 'n_tokens_neox': 399, 'n_words': 218}