Crates.io | samplr |
lib.rs | samplr |
version | 0.1.0 |
source | src |
created_at | 2021-11-28 19:46:35.246003 |
updated_at | 2021-11-28 19:46:35.246003 |
description | CLI tool to randomly sample data |
homepage | https://github.com/SteadBytes/samplr |
repository | https://github.com/SteadBytes/samplr |
max_upload_size | |
id | 488942 |
size | 19,227 |
samplr is a CLI tool to randomly sample data; generating a fixed size sample of input lines with uniform probabilities.
Requires Rust to be installed.
git clone https://github.com/SteadBytes/sample.git
cd sample
cargo install --path .
Sample 15 lines from a file:
sample -n 15 things.txt
Sample 15 lines from standard input:
<things.txt | sample -n 15
Sample 15 lines from multiple files:
sample -n 15 things.txt other_things.txt
samplr uses a Reservoir Sampling algorithm to generate fixed size samples from an input stream of unknown length. For more details, see the implementation and the linked blog article.
Run unit tests:
cargo test
Run all tests (including potentially CPU intensive statistical tests):
cargo test --all-features --release