{"id":13592064,"url":"https://github.com/nferraz/st","last_synced_at":"2025-10-21T04:54:54.062Z","repository":{"id":10395340,"uuid":"12546454","full_name":"nferraz/st","owner":"nferraz","description":"simple statistics from the command line","archived":false,"fork":false,"pushed_at":"2023-05-25T09:32:57.000Z","size":69,"stargazers_count":927,"open_issues_count":12,"forks_count":69,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-08-29T15:17:06.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ibm-watson-iot/iot-html5-phone","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nferraz.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog","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}},"created_at":"2013-09-02T18:29:52.000Z","updated_at":"2025-08-26T23:08:42.000Z","dependencies_parsed_at":"2024-01-14T18:09:26.382Z","dependency_job_id":null,"html_url":"https://github.com/nferraz/st","commit_stats":{"total_commits":98,"total_committers":4,"mean_commits":24.5,"dds":"0.11224489795918369","last_synced_commit":"915674e31bea860345c4980bef1dc6a955757cb4"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/nferraz/st","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nferraz%2Fst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nferraz%2Fst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nferraz%2Fst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nferraz%2Fst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nferraz","download_url":"https://codeload.github.com/nferraz/st/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nferraz%2Fst/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280207203,"owners_count":26290616,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T16:01:05.414Z","updated_at":"2025-10-21T04:54:54.047Z","avatar_url":"https://github.com/nferraz.png","language":"Perl","readme":"st\n==\n\nsimple statistics from the command line interface (CLI)\n\n### Description\n\nImagine you have this sample file:\n\n    $ cat numbers.txt\n    1\n    2\n    3\n    4\n    5\n    6\n    7\n    8\n    9\n    10\n\nHow do you calculate the sum of the numbers?\n\n#### The traditional way\n\nIf you ask around, you'll come up with suggestions like these:\n\n    $ awk '{s+=$1} END {print s}' numbers.txt\n    55\n\n    $ perl -lne '$x += $_; END { print $x; }' numbers.txt\n    55\n\n    $ sum=0; while read num ; do sum=$(($sum + $num)); done \u003c numbers.txt ; echo $sum\n    55\n\n    $ paste -sd+ numbers.txt | bc\n    55\n\nNow imagine that you need to calculate the arithmetic mean, median,\nor standard deviation...\n\n\n#### Using st\n\n\"st\" is a command-line tool to calculate simple statistics from a\nfile or standard input.\n\nLet's start with \"sum\":\n\n    $ st --sum numbers.txt\n    55\n\nThat was easy!\n\nHow about mean and standard deviation?\n\n    $ st --mean --stddev numbers.txt\n    mean  stddev\n    5.5   3.02765\n\nIf you don't specify any options, you'll get this output:\n\n    $ st numbers.txt\n    N     min   max   sum   mean  stddev\n    10    1     10    55    5.5   3.02765\n\nYou can switch rows and columns using the \"--transpose-output\" option:\n\n    $ st --transpose-output numbers.txt\n    N       10\n    min     1\n    max     10\n    sum     55\n    mean    5.5\n    stddev  3.02765\n\nThe \"--summary\" option will provide the five-number summary:\n\n    $ st --summary numbers.txt\n    min   q1    median  q3    max\n    1     3.5   5.5     7.5   10\n\nAnd \"--complete\" will print a complete description:\n\n    $ st --complete numbers.txt\n    N   min   q1    median  q3    max   sum   mean  stddev  stderr\n    10  1     3.5   5.5     7.5   10    55    5.5   3.02765 0.957427\n\n#### How does it compare with R, Octave and other analytical tools?\n\n\"R\" and Octave are integrated suites for data manipulation, calculation\nand graphical display.\n\nThey provide high-level interpreted languages, capabilities for the\nnumerical solution of linear and nonlinear problems, and for\nperforming other numerical experiments, including statistical tests,\nclassification, clustering, etc.\n\n\"st\" is a simpler solution for simpler problems, focused on descriptive\nstatistics for small datasets, handy when you need quick results\nwithout leaving the shell.\n\n\n### Usage\n\n    st [options] [file]\n\n#### Options\n\n##### Functions\n\n    --N|n|count\n    --mean|avg|m\n    --stddev|sd\n    --stderr|sem|se\n    --sum|s\n    --var|variance\n\n    --min\n    --q1\n    --median\n    --q3\n    --max\n\n    --percentile=\u003c0..1\u003e\n    --quartile=\u003c1..4\u003e\n\nIf no functions are selected, \"st\" will print the default output:\n\n    N     min  max  sum  mean  stddev\n\nYou can also use the following predefined sets of functions:\n\n    --summary   # five-number summary (min q1 median q3 max)\n    --complete  # everything\n\n##### Formatting\n\n    --format|fmt|f=\u003cvalue\u003e  # default: \"%g\"\n    --delimiter|d=\u003cvalue\u003e   # default: \"\\t\"\n\n    --no-header|nh          # don't display header\n    --transpose-output|to   # switch rows and columns\n\nExamples of valid formats (\"--format\" option):\n\n        %d    signed integer, in decimal\n        %e    floating-point number, in scientific notation\n        %f    floating-point number, in fixed decimal notation\n        %g    floating-point number, in %e or %f notation\n\n##### Input validation\n\nBy default, \"st\" skips invalid input with a warning.\n\nYou can change this behavior with the following options:\n\n    --strict   # throws an error, interrupting process\n    --quiet|q  # no warning\n\n### Author\n\nNelson Ferraz \u003c\u003cnferraz@gmail.com\u003e\u003e\n\n### Contribute\n\nSend comments, suggestions and bug reports to:\n\nhttps://github.com/nferraz/st/issues\n\nOr fork the code on github:\n\nhttps://github.com/nferraz/st\n","funding_links":[],"categories":["Perl","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnferraz%2Fst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnferraz%2Fst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnferraz%2Fst/lists"}