{"id":13411524,"url":"https://github.com/srfrog/dict","last_synced_at":"2026-03-13T19:39:27.211Z","repository":{"id":56681371,"uuid":"182903954","full_name":"srfrog/dict","owner":"srfrog","description":"Python-like dictionaries for Go","archived":false,"fork":false,"pushed_at":"2026-02-14T19:13:10.000Z","size":47,"stargazers_count":46,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-15T03:43:59.379Z","etag":null,"topics":["dict","go","golang","python"],"latest_commit_sha":null,"homepage":"https://srfrog.dev/dict/","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/srfrog.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-23T02:04:25.000Z","updated_at":"2026-02-14T19:13:15.000Z","dependencies_parsed_at":"2022-08-15T23:10:43.503Z","dependency_job_id":null,"html_url":"https://github.com/srfrog/dict","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/srfrog/dict","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fdict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fdict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fdict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fdict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srfrog","download_url":"https://codeload.github.com/srfrog/dict/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fdict/sbom","scorecard":{"id":843793,"data":{"date":"2025-08-11","repo":{"name":"github.com/srfrog/dict","commit":"54ec0975d78cb36f538c7c4fea0961b99a7e09af"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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":"Code-Review","score":0,"reason":"Found 1/20 approved changesets -- score normalized to 0","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":10,"reason":"no dangerous workflow patterns detected","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/srfrog/dict/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/srfrog/dict/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 3 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"}},{"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"}}]},"last_synced_at":"2025-08-23T21:00:28.412Z","repository_id":56681371,"created_at":"2025-08-23T21:00:28.412Z","updated_at":"2025-08-23T21:00:28.412Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30473448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T17:15:31.527Z","status":"ssl_error","status_checked_at":"2026-03-13T17:15:22.394Z","response_time":60,"last_error":"SSL_read: 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":["dict","go","golang","python"],"created_at":"2024-07-30T20:01:14.251Z","updated_at":"2026-03-13T19:39:27.202Z","avatar_url":"https://github.com/srfrog.png","language":"Go","readme":"# Dict\n[![GoDoc](https://godoc.org/github.com/srfrog/dict?status.svg)](https://godoc.org/github.com/srfrog/dict)\n[![Go Report Card](https://goreportcard.com/badge/github.com/srfrog/dict?svg=1)](https://goreportcard.com/report/github.com/srfrog/dict)\n[![Coverage Status](https://coveralls.io/repos/github/srfrog/dict/badge.svg?branch=master)](https://coveralls.io/github/srfrog/dict?branch=master)\n![Build Status](https://github.com/srfrog/dict/actions/workflows/go.yml/badge.svg?branch=master)\n\n*Python dictionary data type (dict) in Go*\n\nPackage dict is a Go implementation of Python [dict][1], which are hashable object maps.\nDictionaries complement Go map and slice types to provide a simple interface to\nstore and access key-value data with relatively fast performance at the cost of extra\nmemory. This is done by using the features of both maps and slices.\n\n## Quick Start\n\nInstall using \"go get\":\n\n\tgo get github.com/srfrog/dict\n\nThen import from your source:\n\n\timport \"github.com/srfrog/dict\"\n\nView [example_test.go][2] for an extended example of basic usage and features.\n\n## Features\n\n- [x] Initialize a new dict with scalars, slices, maps, channels and other dictionaries.\n- [x] Go types int, uint, float, string and fmt.Stringer are hashable for dict keys.\n- [x] Go map keys are used for dict keys if they are hashable.\n- [x] Dict items are sorted in their insertion order, unlike Go maps.\n- [x] Go routine safe with minimal mutex locking (WIP)\n- [x] Builtin JSON support for marshalling and unmarshalling\n- [ ] sql.Scanner support via optional sub-package (WIP)\n- [x] Plenty of tests and examples to get you started quickly\n\n## Documentation\n\nThe full code documentation is located at GoDoc:\n\n[http://godoc.org/github.com/srfrog/dict](http://godoc.org/github.com/srfrog/dict)\n\nThe source code is thoroughly commented, have a look.\n\n## Usage\n\nMinimal example showing basic usage:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/srfrog/dict\"\n)\n\ntype Car struct {\n\tModel, BrandID string\n\tRecalls        int\n}\n\nfunc main() {\n\t// Map of car models, indexed by VIN.\n\t// Data source: NHTSA.gov\n\tvins := map[string]*Car{\n\t\t\"2C3KA43R08H129584\": \u0026Car{\n\t\t\tModel:   \"2008 CHRYSLER 300\",\n\t\t\tBrandID: \"ACB9976A-DB5F-4D57-B9A8-9F5C53D87C7C\",\n\t\t\tRecalls: 1,\n\t\t},\n\t\t\"1N6AD07U78C416152\": \u0026Car{\n\t\t\tModel:   \"2008 NISSAN FRONTIER SE-V6 RWD\",\n\t\t\tBrandID: \"003096EE-C8FC-4C2F-ADEF-406F86C1F70B\",\n\t\t\tRecalls: 5,\n\t\t},\n\t\t\"WDDGF8AB8EA940372\": \u0026Car{\n\t\t\tModel:   \"2014 Mercedes-Benz C300W4\",\n\t\t\tBrandID: \"57B7B707-4357-4306-9FD6-1EDCA43CF77B\",\n\t\t\tRecalls: 4,\n\t\t},\n\t}\n\n\t// Create new dict and initialize with vins map.\n\td := dict.New(vins)\n\n\t// Add a couple more VINs.\n\td.Set(\"1N4AL2AP4BN404580\", \u0026Car{\n\t\tModel:   \"2011 NISSAN ALTIMA 2.5 S CVT\",\n\t\tBrandID: \"003096EE-C8FC-4C2F-ADEF-406F86C1F70B\",\n\t\tRecalls: 2,\n\t})\n\td.Set(\"4T1BE46K48U762452\", \u0026Car{\n\t\tModel:   \"2008 TOYOTA Camry\",\n\t\tBrandID: \"C5764FE4-F1E8-46BE-AFC6-A2FC90110387\",\n\t\tRecalls: 5,\n\t})\n\n\t// Check current total\n\tfmt.Println(\"Total VIN Count:\", d.Len())\n\n\t// Print VINs that have 3 or more recalls\n\tfor item := range d.Items() {\n\t\tcar, ok := item.Value.(*Car)\n\t\tif !ok {\n\t\t\tcontinue // Not a Car\n\t\t}\n\t\tif car.Recalls \u003c 3 {\n\t\t\tcontinue // Not enough recalls\n\t\t}\n\t\tfmt.Println(\"---\")\n\t\tfmt.Println(\"VIN:\", item.Key)\n\t}\n}\n\n```\n\n[1]: https://docs.python.org/3.7/library/stdtypes.html#dict\n[2]: https://github.com/srfrog/dict/blob/master/example_test.go\n","funding_links":[],"categories":["Data Structures and Algorithms","数据结构与算法","Uncategorized","Data Structures","Generators","数据结构`go语言实现的数据结构与算法`","数据结构","Data Integration Frameworks"],"sub_categories":["Maps","地图","Advanced Console UIs","Standard CLI","标准 CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrfrog%2Fdict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrfrog%2Fdict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrfrog%2Fdict/lists"}