{"id":32955017,"url":"https://github.com/nathanepstein/datakit","last_synced_at":"2026-01-21T21:43:23.111Z","repository":{"id":28071188,"uuid":"31568327","full_name":"NathanEpstein/datakit","owner":"NathanEpstein","description":"A lightweight framework for data analysis in JavaScript.","archived":false,"fork":false,"pushed_at":"2017-04-09T15:10:09.000Z","size":211,"stargazers_count":290,"open_issues_count":0,"forks_count":11,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-10-31T02:27:28.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NathanEpstein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-02T23:05:43.000Z","updated_at":"2024-12-08T14:40:39.000Z","dependencies_parsed_at":"2022-09-04T16:50:10.928Z","dependency_job_id":null,"html_url":"https://github.com/NathanEpstein/datakit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NathanEpstein/datakit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanEpstein%2Fdatakit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanEpstein%2Fdatakit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanEpstein%2Fdatakit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanEpstein%2Fdatakit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NathanEpstein","download_url":"https://codeload.github.com/NathanEpstein/datakit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanEpstein%2Fdatakit/sbom","scorecard":{"id":99132,"data":{"date":"2025-08-11","repo":{"name":"github.com/NathanEpstein/datakit","commit":"890ab8178218400421844c1748025510ff17b366"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 2/17 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T09:46:06.407Z","repository_id":28071188,"created_at":"2025-08-15T09:46:06.407Z","updated_at":"2025-08-15T09:46:06.407Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284145006,"owners_count":26954846,"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-11-13T02:00:06.582Z","response_time":61,"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":"2025-11-12T22:00:41.097Z","updated_at":"2025-11-13T03:00:56.353Z","avatar_url":"https://github.com/NathanEpstein.png","language":"JavaScript","funding_links":[],"categories":["Javascript","JavaScript"],"sub_categories":["Tools","[Tools](#tools-1)","Speech Recognition"],"readme":"# datakit\n\n\u003cimg src=\"https://travis-ci.org/NathanEpstein/datakit.svg?branch=master\"\u003e\n\u003cimg src=\"./plot.png\"\u003e\n\n## About\nA lightweight library/framework for data analysis in JavaScript.\n\n## Usage\n\n```npm install datakitjs --save```\n\n## Documentation \u0026 Examples\n\n### Reading, Filtering, \u0026 Plotting Data\n```javascript\nvar dk = require('datakitjs');\n\n//READ A CSV FILE\n\n//file.csv\n// COL1, COL2\n// val11, val12\n// val21, val22\n\ndk.csv('file.csv', function(data) {\n  console.log(data);\n});\n\n//Output:\n//[{ COL1: val11, COL2: val12 }, { COL1: val21, COL2: val22 }]\n\n\n//GET A COLUMN FROM AN ARRAY OF ROW OBJECTS\ndk.csv('file.csv', function(data) {\n  var c2 = dk.col(data, 'COL2');\n  console.log(c2);\n});\n\n//Output:\n//[val12, val22]\n\n// By default, dk.csv will convert all values to strings. You can convert select\n// columns to numbers by passing an array of column names to 'dk.numeric'.\n\n//file2.csv\n// COL1, COL2\n// val11, 1\n// val21, 2\n\ndk.csv('file2.csv', function(data) {\n  var d = dk.numeric(data, ['COL2'], 0) // The third parameter value will be filled\n  // in to blank cells. Its default value is 0.\n  var c2 = dk.col(d, 'COL2');\n  console.log(c2);\n});\n\n//Output:\n//[1, 2]\n\n\n//PLOT ARRAY(S) OF DATA\n\nvar chart = new dk.Chart({\n  //optional config\n  height: 500,\n  width: 500,\n  xLab: 'x-Axis Label',\n  yLab: 'y-Axis Label'\n});\n\nchart.addDataSet({\n  x: [1, 2, 3],\n  y: [4, 5, 6],\n  z: [2, 3, 5],\n  colors: ['blue', 'green', 'red']\n}).addDataSet({\n  x: [1, 10],\n  y: [2, -1],\n  type: 'line'\n}).addDataSet({\n  x: [10, 5, 1],\n  y: [4, 5, 2],\n  labels: [\"first\", \"second\", \"third\"]\n}).plot();\n```\n\n### Statistical Methods\n\n```javascript\nvar dk = require('datakitjs');\n\n//MEAN OF AN ARRAY\ndk.mean([1, 2, 3]); //returns 2\n\n//STANDARD DEVIATION AND VARIANCE OF AN ARRAY\ndk.sd([1, 2, 3]); //returns 1\ndk.vari([1, 2, 3]); //returns 1\n\n//COVARIANCE OF TWO ARRAYS\ndk.cov([1, 2, 3], [3, 2, 1]); //returns -1\n\n//SIMPLE LINEAR REGRESSION\n\nvar x = [1, 2, 3];\nvar y = [2, 1, 3];\n\nvar model = dk.reg(x, y);\n\n// model.f is a function that returns the estimated y for an input x (estimated via standard OLS regression)\n// model.f = function(x) {\n//  return (a + b * x);\n// };\n\n// model.pts is an array of the estimated y for each element of x\n// model.pts = [1.5, 2, 2.5];\n\n// model.endPoints is an object with the coordinates of the boundary points\n// model.endPoints = { x1: 1, x2: 3, y1: 1.5, y2: 2.5 };\n\n```\n\n### Convenience Methods\n```javascript\nvar dk = require('datakitjs');\n\n//GENERATE AN ARRAY WITH A SEQUENCE OF NUMBERS\n\ndk.seq(1, 5); //returns [1, 2, 3, 4, 5]\n\ndk.seq(0, 1, 0.25); //returns [0, 0.25, 0.5, 0.75, 1]\n\n//GENERATE AN ARRAY WITH REPEATED VALUE\n\ndk.rep(1, 5); //returns [1, 1, 1, 1, 1]\n\n//CHECK IF NUMBERS ARE CLOSE\ndk.isclose(0, Math.pow(10, -15)); //returns true\n\ndk.isclose(0, Math.pow(10, -5)); //returns false\n\n//SUM AN ARRAY OF NUMBERS\n//uses Kahan summation\n\ndk.sum([1, 2, 3]); //returns 6\n\n//PRODUCT OF AN ARRAY OF NUMBERS\n//implementation from 'Accurate Floating Point Product' - Stef Graillat\n\ndk.prod([1, 2, 3]); //returns 6\n\n//MAX AND MIN OF AN ARRAY\nvar x = [1, 2, 3];\ndk.min(x); //returns 1\ndk.max(x); //returns 3\n\n```\n\n### Random Numbers\n```javascript\nvar dk = require('datakitjs');\n\n//GET AN ARRAY OF EXPONENTIALLY DISTRIBUTED VALUES\n\ndk.exp(3, 1); //returns [0.3584189321510761, 1.0466439500242446, 0.08887770301056963]\n\n\n//GET AN ARRAY OF NORMALLY DISTRIBUTED VALUES\n\ndk.norm(3, 0, 1); //returns [-1.709768103193772, 0.23530041388459744, 0.4431320382580479]\n\n//GET AN ARRAY OF UNIFORMLY DISTRIBUTED VALUES\n\ndk.uni(3); //returns [0.30658303829841316, 0.1601463456172496, 0.8538850131444633]\n\n```\n\n## Testing\n\nJust run `npm test` to run the tests.\n\n\n## Contributing\n\nAdditional methods for random number generation, data filtration, convenience functions, and common statistical analyses are welcome additions. Just add tests following the structure in `spec/test/testSpec.js`.\n\n## License\n\n**The MIT License (MIT)**\n\n\u003e Copyright (c) 2015 Nathan Epstein\n\u003e\n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy\n\u003e of this software and associated documentation files (the \"Software\"), to deal\n\u003e in the Software without restriction, including without limitation the rights\n\u003e to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\u003e copies of the Software, and to permit persons to whom the Software is\n\u003e furnished to do so, subject to the following conditions:\n\u003e\n\u003e The above copyright notice and this permission notice shall be included in\n\u003e all copies or substantial portions of the Software.\n\u003e\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\u003e IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\u003e FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\u003e AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\u003e LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\u003e OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\u003e THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanepstein%2Fdatakit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanepstein%2Fdatakit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanepstein%2Fdatakit/lists"}