{"id":19506271,"url":"https://github.com/ne-sachirou/stream_stat","last_synced_at":"2026-02-06T11:34:47.428Z","repository":{"id":59156587,"uuid":"70154018","full_name":"ne-sachirou/stream_stat","owner":"ne-sachirou","description":"StreamStat: Aggregate large data statictics with streaming.","archived":false,"fork":false,"pushed_at":"2025-01-05T17:17:38.000Z","size":54,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-05T05:54:17.077Z","etag":null,"topics":["data-statictics"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ne-sachirou.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,"zenodo":null}},"created_at":"2016-10-06T12:58:12.000Z","updated_at":"2016-10-31T11:57:37.000Z","dependencies_parsed_at":"2025-05-07T06:06:47.124Z","dependency_job_id":"74095d8a-4c3f-4e18-ac63-3f5ec3bbdcd8","html_url":"https://github.com/ne-sachirou/stream_stat","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ne-sachirou/stream_stat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ne-sachirou%2Fstream_stat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ne-sachirou%2Fstream_stat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ne-sachirou%2Fstream_stat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ne-sachirou%2Fstream_stat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ne-sachirou","download_url":"https://codeload.github.com/ne-sachirou/stream_stat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ne-sachirou%2Fstream_stat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29159600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["data-statictics"],"created_at":"2024-11-10T22:36:18.767Z","updated_at":"2026-02-06T11:34:47.399Z","avatar_url":"https://github.com/ne-sachirou.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"StreamStat: Aggregate large data statictics with streaming.\n\n[![Gem Version](https://badge.fury.io/rb/stream_stat.svg)](https://badge.fury.io/rb/stream_stat)\n[![Dependency Status](https://gemnasium.com/badges/github.com/ne-sachirou/stream_stat.svg)](https://gemnasium.com/github.com/ne-sachirou/stream_stat)\n[![Build Status](https://travis-ci.org/ne-sachirou/stream_stat.svg?branch=master)](https://travis-ci.org/ne-sachirou/stream_stat)\n[![Code Climate](https://codeclimate.com/github/ne-sachirou/stream_stat/badges/gpa.svg)](https://codeclimate.com/github/ne-sachirou/stream_stat)\n[![Test Coverage](https://codeclimate.com/github/ne-sachirou/stream_stat/badges/coverage.svg)](https://codeclimate.com/github/ne-sachirou/stream_stat/coverage)\n\nStreamStat\n==\nA library to aggragate statistics of large data with streaming, less memory.\n\nCurrently supported are:\n\n- average 平均 `:avg`\n- variance 分散 `:variance`\n- standard deviation 標準偏差 `:sd`\n- minimun 最小値 `:min`\n- maximum 最大値 `:max`\n\nUsage\n--\n\nAggragate a SD of large_data.\n\n```ruby\n# Monkey patch\nmodule Enumerable\n  def last\n    inject { |_a, v| v }\n  end\nend\n\nlarge_data = (1..100_000).lazy.collect { rand 100_000 }\np StreamStat.new(large_data).last.sd\n```\n\nView the intermediate results.\n\n```ruby\n# Monkey patch\nmodule Enumerable\n  def each_tap\n    collect do |*item|\n      yield(*item)\n      item\n    end\n  end\n\n  def last\n    inject { |_a, v| v }\n  end\nend\n\ndef pstat(stat)\n  puts \u003c\u003c-EOF\navg:\\t#{stat.avg}\nvariance:\\t#{stat.variance}\nsd:\\t#{stat.sd}\nmin:\\t#{stat.min}\nmax:\\t#{stat.max}\nEOF\nend\n\nlarge_data = (1..100_000).lazy.collect { rand 100_000 }\nstat = StreamStat.new(large_data)\n                 .lazy\n                 .each_with_index\n                 .each_tap { |st, i| pstat st if (i % 10_000).zero? }\n                 .last[0]\npstat stat\n```\n\n[doc](http://www.rubydoc.info/gems/stream_stat)\n\nInstallation\n--\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'stream_stat'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install stream_stat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fne-sachirou%2Fstream_stat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fne-sachirou%2Fstream_stat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fne-sachirou%2Fstream_stat/lists"}