{"id":17124970,"url":"https://github.com/shellyln/go-graphdt","last_synced_at":"2026-05-04T04:32:58.715Z","repository":{"id":154011421,"uuid":"631145227","full_name":"shellyln/go-graphdt","owner":"shellyln","description":"A datatable that represents object graphs for Go.","archived":false,"fork":false,"pushed_at":"2023-05-07T09:01:06.000Z","size":737,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T09:44:58.805Z","etag":null,"topics":["csv","datatable","datatables","datatables-library","go","golang","json","library","mapreduce","object-graph","query-engine"],"latest_commit_sha":null,"homepage":"","language":"Go","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/shellyln.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-04-22T04:31:02.000Z","updated_at":"2023-07-10T05:37:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c9a5980-1a51-46da-b18d-96a9b3f494d3","html_url":"https://github.com/shellyln/go-graphdt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-graphdt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-graphdt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-graphdt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-graphdt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellyln","download_url":"https://codeload.github.com/shellyln/go-graphdt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245204422,"owners_count":20577348,"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":["csv","datatable","datatables","datatables-library","go","golang","json","library","mapreduce","object-graph","query-engine"],"created_at":"2024-10-14T18:43:48.693Z","updated_at":"2026-05-04T04:32:53.683Z","avatar_url":"https://github.com/shellyln.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphDT\n\nA datatable that represents object graphs.\n\n\n[![Test](https://github.com/shellyln/go-graphdt/actions/workflows/test.yml/badge.svg)](https://github.com/shellyln/go-graphdt/actions/workflows/test.yml)\n[![release](https://img.shields.io/github/v/release/shellyln/go-graphdt)](https://github.com/shellyln/go-graphdt/releases)\n[![Go version](https://img.shields.io/github/go-mod/go-version/shellyln/go-graphdt)](https://github.com/shellyln/go-graphdt)\n\n\u003cimg src=\"https://raw.githubusercontent.com/shellyln/go-graphdt/master/_assets/logo-graphdt.svg\" alt=\"logo\" style=\"width:250px;\" width=\"250\"\u003e\n\n---\n\n\n## ⭐️ Features\n\n* Sort by multiple columns\n* Filter by multiple columns and/or formulas that can include function calls\n* Select multiple columns and/or formulas that can include scalar function calls\n* Aggregate multiple columns and/or formulas that can include aggregation function calls\n    * Group by multiple columns\n    * Filter by aggregated values\n* Simple iteration of rows\n* Object graph based traversal for each row\n* Create new data table from describe\n* Import and export to CSV\n* Import and export to JSON Lines\n* Unmarshal to untyped objects\n* Unmarshal to typed objects\n\n## 🚀 Getting started\n\n```go\npackage main\n\nimport (\n    \"bytes\"\n    \"encoding/csv\"\n    \"fmt\"\n    \"github.com/shellyln/go-graphdt/datatable\"\n    \"github.com/shellyln/go-graphdt/datatable/runtime\"\n    \"github.com/shellyln/go-graphdt/datatable/types\"\n)\n\nvar csv1Bytes []byte\nvar csv2Bytes []byte\n\nfunc main() {\n    csv1Bytes = []byte(`Foo,Bar,Baz\n1,2,3`)\n    csv2Bytes = []byte(`Foo,Qux,Quux,Corge\n1,1,2,3\n1,11,12,13`)\n\n    ctx := runtime.NewRuntimeContext()\n\n    dt1 := datatable.NewDataTableWithSize(\n        ctx, 0, 0,\n        types.Type_Nullable_String,\n        types.Type_Nullable_I64,\n        types.Type_Nullable_F64,\n    )\n    dt1.SetSimpleHeader([]string{\"Foo\", \"Bar\", \"Baz\"})\n\n    dt2 := datatable.NewDataTableWithSize(\n        ctx, 0, 0,\n        types.Type_Nullable_String,\n        types.Type_Nullable_String,\n        types.Type_Nullable_I64,\n        types.Type_Nullable_F64,\n    )\n    dt2.SetSimpleHeader([]string{\"Foo\", \"Qux\", \"Quux\", \"Corge\"})\n\n    buf1 := bytes.NewReader(csv1Bytes)\n    reader1 := csv.NewReader(buf1)\n\n    if err := dt1.AppendFromCSV(reader1, datatable.CSVOptions{HasHeader: true}); err != nil {\n        fmt.Printf(\"error = %v\\n\", err)\n        return\n    }\n\n    err := dt1.Filter([]types.FilterInfo{\n        {Op: types.Op_LoadCol, Col: 1},\n        {Op: types.Op_LoadImmediate, Param: 63},\n        {Op: types.Op_Lt},\n        {Op: types.Op_LoadCol, Col: 1},\n        {Op: types.Op_LoadImmediate, Param: 64},\n        {Op: types.Op_Gt},\n        {Op: types.Op_Or},\n    }...)\n    if err != nil {\n        fmt.Printf(\"error = %v\\n\", err)\n        return\n    }\n\n    err = dt1.Sort([]types.SortInfo{\n        {Col: 0, Desc: false, NullsLast: true},\n        {Col: 2},\n    }...)\n    if err != nil {\n        fmt.Printf(\"error = %v\\n\", err)\n        return\n    }\n\n    buf2 := bytes.NewReader(csv2Bytes)\n    reader2 := csv.NewReader(buf2)\n\n    if err := dt2.AppendFromCSV(reader2, datatable.CSVOptions{HasHeader: true}); err != nil {\n        fmt.Printf(\"error = %v\\n\", err)\n        return\n    }\n\n    result, err := dt1.LeftJoin(0, dt2, 0, \"quxes\", datatable.JoinOptions{})\n    if err != nil {\n        fmt.Printf(\"error = %v\\n\", err)\n        return\n    }\n\n    fmt.Println(result.ColNames())\n    fmt.Println(result.ColSimpleNames())\n\n    values := make([]interface{}, result.ColLen())\n    result.ForEach(func(i int, row datatable.DataRow) bool {\n        fmt.Println(row.Values(values))\n        return false\n    })\n\n    result.ToUntyped(func(i int, record map[string]interface{}) bool {\n        fmt.Println(record)\n        return false\n    })\n}\n```\n\n## 🚧 TODO\n\n* Standard scalar / aggregation functions\n* Data adapter interface\n* Unit tests\n* Documents\n\n\n## ⚖️ License\n\nMIT  \nCopyright (c) 2023 Shellyl_N and Authors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellyln%2Fgo-graphdt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellyln%2Fgo-graphdt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellyln%2Fgo-graphdt/lists"}