{"id":22243340,"url":"https://github.com/galaco/keyvalues","last_synced_at":"2025-07-28T01:32:39.551Z","repository":{"id":55449114,"uuid":"152269101","full_name":"Galaco/keyvalues","owner":"Galaco","description":"Source engine KeyValue format parser (e.g. gameinfo.txt, vmt, vmf)","archived":false,"fork":false,"pushed_at":"2023-12-15T05:46:58.000Z","size":29,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-22T05:24:34.818Z","etag":null,"topics":["game-info","gameinfo","keyvalue","keyvalue-files","source-engine","valve","vmt"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Galaco.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}},"created_at":"2018-10-09T14:47:23.000Z","updated_at":"2023-04-10T22:28:52.000Z","dependencies_parsed_at":"2024-06-19T01:45:57.389Z","dependency_job_id":"82cc2903-27e6-49a9-ada5-203ccf71a339","html_url":"https://github.com/Galaco/keyvalues","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fkeyvalues","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fkeyvalues/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fkeyvalues/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fkeyvalues/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Galaco","download_url":"https://codeload.github.com/Galaco/keyvalues/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227853593,"owners_count":17829763,"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":["game-info","gameinfo","keyvalue","keyvalue-files","source-engine","valve","vmt"],"created_at":"2024-12-03T04:26:01.590Z","updated_at":"2024-12-03T04:26:02.214Z","avatar_url":"https://github.com/Galaco.png","language":"Go","readme":"[![GoDoc](https://godoc.org/github.com/Galaco/KeyValues?status.svg)](https://godoc.org/github.com/Galaco/KeyValues)\n[![Go report card](https://goreportcard.com/badge/github.com/galaco/KeyValues)](https://goreportcard.com/badge/github.com/galaco/KeyValues)\n[![Build Status](https://travis-ci.com/Galaco/KeyValues.svg?branch=master)](https://travis-ci.com/Galaco/KeyValues)\n\n# keyvalues\n\u003e A zero-dependency library for Parsing Valve KeyValue format data.\n\nGo library for parsing Valve keyvalue format files. This library constructs a simple kv node tree that you can\nquery any structure(s) and any property(s) of.\n\nIt has been tested against various gameinfo.txt engine files, but should work with other KeyValue files as\nwell (such as .vmf or .vmt).\n\nIt is important to note that KeyValue's appear to support (in certain rare uses of the format) multiple root nodes in a \nsingle definition. This package will create a root node with Key `$root` in this situation, with all root nodes as \nchildren. If there is only a single root node, the root node will be as defined in the KeyValues.\n\n### Usage\n```golang\npackage main\n\nimport (\n    \"log\"\n    \"os\"\n    \"github.com/galaco/keyvalues\"\n)\n\nfunc main() {\n\tfile,_ := os.Open(\"gameinfo.txt\")\n\n\treader := keyvalues.NewReader(file)\n\tkv,_ := reader.Read()\n\n    // counterstrike: source's gameinfo.txt would return \"Counter-Strike Source\"\n    gameInfoNode,_ := kv.Find(\"GameInfo\")\n    gameNode,_ := gameInfoNode.Find(\"game\")\n    log.Println(gameNode.AsString())\n\n    // counterstrike: source's gameinfo.txt would return 1\n    noModelsNode,_ := gameInfoNode.Find(\"nomodels\")\n    log.Println(noModelsNode.AsInt())\n\n    // counterstrike: source's gameinfo.txt would return 240\n    fileSystemNode,_ := gameInfoNode.Find(\"FileSystem\")\n    appIdNode,_ := fileSystemNode.Find(\"SteamAppId\")\n    log.Println(appIdNode.AsInt())\n}\n```\n\n### Todo\n* Implement multi-line values. At present, a `\\n` character in a quoted value will break the parser. This is how CS:GO\nHammer behaves. However, other versions of Hammer support this, as well as all engine versions. Worth noting what spec\nis available doesn't cover this behaviour.\n* Implement pointer value type (unsure if there is any point to this besides matching spec)\n* Proper test coverage\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalaco%2Fkeyvalues","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalaco%2Fkeyvalues","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalaco%2Fkeyvalues/lists"}