{"id":18341755,"url":"https://github.com/jerluc/samp","last_synced_at":"2025-04-13T10:43:36.464Z","repository":{"id":255096722,"uuid":"848531992","full_name":"jerluc/samp","owner":"jerluc","description":"A simple CLI that randomly samples lines from standard input","archived":false,"fork":false,"pushed_at":"2024-08-27T23:59:15.000Z","size":5,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T02:08:10.308Z","etag":null,"topics":["command-line-tool","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jerluc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-27T23:56:27.000Z","updated_at":"2024-09-23T19:37:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"46e47b0e-7592-4458-b811-52c81cf0c953","html_url":"https://github.com/jerluc/samp","commit_stats":null,"previous_names":["jerluc/samp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerluc","download_url":"https://codeload.github.com/jerluc/samp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248701980,"owners_count":21148111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","rust"],"created_at":"2024-11-05T20:28:23.018Z","updated_at":"2025-04-13T10:43:36.440Z","avatar_url":"https://github.com/jerluc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `samp` (sampler)\n\n`samp` is a simple command-line program that randomly samples lines from standard input. This can\nbe used to trim down on large newline-delimited files for testing or other purposes.\n\n## Installation\n\nTo get started, install `samp` from source:\n\n```shell\n# Directly from Github\ncargo install --git https://github.com/jerluc/samp.git\n\n# Or from local source\ngit clone https://github.com/jerluc/samp.git \u0026\u0026 cd samp/ \u0026\u0026 cargo install --path .\n```\n\n## Usage\n\nTo use `samp`:\n\n```\nUsage: samp [-r \u003cratio\u003e] [-s \u003cseed\u003e]\n\nSample stdin\n\nOptions:\n  -r, --ratio       sample ratio\n  -s, --seed        seed string\n  --help            display usage information\n```\n\nFor example, here's how you can randomly sample ~10% of your computer's dictionary file:\n\n```shell\ncat /usr/share/dict/words | samp -r 0.1\n```\n\nAnd here's how you can randomly sample ~5% of \"War and Peace\" using a reproducible text seed:\n\n```shell\n# Save sample to file\ncurl -s https://www.gutenberg.org/cache/epub/2600/pg2600.txt | samp -r 0.05 -s tolstoy \u003e wp.txt\n\n# Save second sample to another file\ncurl -s https://www.gutenberg.org/cache/epub/2600/pg2600.txt | samp -r 0.05 -s tolstoy \u003e wp2.txt\n\ndiff wp.txt wp2.txt\n# No differences!\n```\n\n## Motivations\n\nI basically had two motivations in creating this software:\n\n1. I often find myself working with very large, newline-delimited data; I use `samp` to randomly\n   down-sample this data for running various tests\n2. I wanted an excuse to practice some more Rust :)\n\n## Contributing\n\nWhen contributing to this repository, please follow the steps below:\n\n1. Fork the repository\n2. Submit your patch in one commit, or a series of well-defined commits\n3. Submit your pull request and make sure you reference the issue you are addressing\n\n## License\n\nSee [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerluc%2Fsamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerluc%2Fsamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerluc%2Fsamp/lists"}