{"id":18418615,"url":"https://github.com/bsm/extsort","last_synced_at":"2025-04-07T13:31:20.858Z","repository":{"id":48976940,"uuid":"188973954","full_name":"bsm/extsort","owner":"bsm","description":"External merge sort algorithm, implemented in Go","archived":false,"fork":false,"pushed_at":"2023-04-11T08:09:32.000Z","size":45,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-22T19:02:54.428Z","etag":null,"topics":["external","external-sorting","golang","sort-algorithms","sorting-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bsm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-05-28T07:09:32.000Z","updated_at":"2024-11-12T08:15:34.000Z","dependencies_parsed_at":"2024-06-19T05:26:27.914Z","dependency_job_id":"686bb2a9-fe28-45cd-9f7b-9dfd570d889d","html_url":"https://github.com/bsm/extsort","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fextsort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fextsort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fextsort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fextsort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsm","download_url":"https://codeload.github.com/bsm/extsort/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247661669,"owners_count":20975096,"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":["external","external-sorting","golang","sort-algorithms","sorting-algorithms"],"created_at":"2024-11-06T04:14:08.012Z","updated_at":"2025-04-07T13:31:20.499Z","avatar_url":"https://github.com/bsm.png","language":"Go","readme":"# ExtSort\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/bsm/extsort.svg)](https://pkg.go.dev/github.com/bsm/extsort)\n[![Test](https://github.com/bsm/extsort/actions/workflows/test.yml/badge.svg)](https://github.com/bsm/extsort/actions/workflows/test.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nExternal merge sort algorithm, implemented in [Go](https://golang.org). Sort arbitrarily large data sets\nwith a predictable amount of memory using disk.\n\n## Example:\n\nSorting lines:\n\n```go\nimport(\n  \"fmt\"\n\n  \"github.com/bsm/extsort\"\n)\n\nfunc main() {\n\t// Init sorter.\n\tsorter := extsort.New(nil)\n\tdefer sorter.Close()\n\n\t// Append plain data.\n\t_ = sorter.Append([]byte(\"foo\"))\n\t_ = sorter.Append([]byte(\"bar\"))\n\t_ = sorter.Append([]byte(\"baz\"))\n\t_ = sorter.Append([]byte(\"dau\"))\n\n\t// Sort and iterate.\n\titer, err := sorter.Sort()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer iter.Close()\n\n\tfor iter.Next() {\n\t\tfmt.Println(string(iter.Data()))\n\t}\n\tif err := iter.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n```\n\nMap-style API with de-duplication:\n\n```go\nimport(\n  \"fmt\"\n\n  \"github.com/bsm/extsort\"\n)\n\nfunc main() {\n\t// Init with de-duplication.\n\tsorter := extsort.New(\u0026extsort.Options{\n\t\tDedupe: bytes.Equal,\n\t})\n\tdefer sorter.Close()\n\n\t// Put key/value data.\n\t_ = sorter.Put([]byte(\"foo\"), []byte(\"v1\"))\n\t_ = sorter.Put([]byte(\"bar\"), []byte(\"v2\"))\n\t_ = sorter.Put([]byte(\"baz\"), []byte(\"v3\"))\n\t_ = sorter.Put([]byte(\"bar\"), []byte(\"v4\"))\t// duplicate\n\t_ = sorter.Put([]byte(\"dau\"), []byte(\"v5\"))\n\n\t// Sort and iterate.\n\titer, err := sorter.Sort()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer iter.Close()\n\n\tfor iter.Next() {\n\t\tfmt.Println(string(iter.Key()), string(iter.Value()))\n\t}\n\tif err := iter.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsm%2Fextsort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsm%2Fextsort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsm%2Fextsort/lists"}