{"id":13821057,"url":"https://github.com/andygrunwald/vdf","last_synced_at":"2025-04-09T12:08:33.155Z","repository":{"id":4304188,"uuid":"52690229","full_name":"andygrunwald/vdf","owner":"andygrunwald","description":"A Lexer and Parser for Valves Data Format (known as vdf) written in Go","archived":false,"fork":false,"pushed_at":"2024-12-14T08:31:08.000Z","size":171,"stargazers_count":49,"open_issues_count":4,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T11:03:24.749Z","etag":null,"topics":["counter-strike","go","hacktoberfest","lexer","steam","valve","valve-data-file","valve-data-format","vdf","vdf-parser"],"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/andygrunwald.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"andygrunwald","custom":"https://paypal.me/andygrunwald"}},"created_at":"2016-02-27T21:43:03.000Z","updated_at":"2025-03-08T19:00:41.000Z","dependencies_parsed_at":"2025-01-16T01:11:18.598Z","dependency_job_id":"d5e1450f-a68a-428d-ac19-725e9110ab04","html_url":"https://github.com/andygrunwald/vdf","commit_stats":{"total_commits":117,"total_committers":6,"mean_commits":19.5,"dds":"0.23931623931623935","last_synced_commit":"fc137397e9a42191686368b4417ba21a4a61cf85"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andygrunwald%2Fvdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andygrunwald%2Fvdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andygrunwald%2Fvdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andygrunwald%2Fvdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andygrunwald","download_url":"https://codeload.github.com/andygrunwald/vdf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036067,"owners_count":21037092,"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":["counter-strike","go","hacktoberfest","lexer","steam","valve","valve-data-file","valve-data-format","vdf","vdf-parser"],"created_at":"2024-08-04T08:01:14.432Z","updated_at":"2025-04-09T12:08:33.128Z","avatar_url":"https://github.com/andygrunwald.png","language":"Go","readme":"# vdf: A Lexer and Parser for Valves Data Format (known as vdf)\n\n[![GoDoc](https://pkg.go.dev/badge/github.com/andygrunwald/vdf?utm_source=godoc)](https://pkg.go.dev/github.com/andygrunwald/vdf)\n[![Go Report Card](https://img.shields.io/badge/go%20report-A+-brightgreen.svg?style=flat)](https://goreportcard.com/report/github.com/andygrunwald/vdf)\n\nA Lexer and Parser for [Valves Data Format (known as vdf)](https://developer.valvesoftware.com/wiki/KeyValues) written in Go.\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API-Documentation](#api-documentation)\n- [Development](#development)\n\t- [Unit testing](#unit-testing)\n\t- [Fuzzing tests](#fuzzing-tests)\n- [Press](#press)\n- [VDF parser in other languages](#vdf-parser-in-other-languages)\n- [Inspiration](#inspiration)\n- [License](#license)\n\n## Installation\n\nIt is go gettable\n\n```\n$ go get github.com/andygrunwald/vdf\n```\n\n## Usage\n\nGiven a file named [`gamestate_integration_consolesample.cfg`](testdata/gamestate_integration_consolesample.cfg) with content:\n\n```\n\"Console Sample v.1\"\n{\n\t\"uri\" \t\t\"http://127.0.0.1:3000\"\n\t\"timeout\" \t\"5.0\"\n\t\"buffer\"  \t\"0.1\"\n\t\"throttle\" \t\"0.5\"\n\t\"heartbeat\"\t\"60.0\"\n\t[...]\n}\n```\n\nCan be parsed with this Go code:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/andygrunwald/vdf\"\n)\n\nfunc main() {\n\tf, err := os.Open(\"gamestate_integration_consolesample.cfg\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tp := vdf.NewParser(f)\n\tm, err := p.Parse()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(m)\n}\n```\n\nAnd it will output:\n\n```\nmap[\n\tConsole Sample v.1:map[\n\t\turi:http://127.0.0.1:3000\n\t\ttimeout:5.0\n\t\tbuffer:0.1\n\t\tthrottle:0.5\n\t\theartbeat:60.0\n\t\t[...]\n\t]\n]\n```\n\n## API-Documentation\n\nThe official Go package documentation can be found at https://pkg.go.dev/github.com/andygrunwald/vdf.\n\n## Development\n\n### Unit testing\n\nTo run the local unit tests, execute\n\n```sh\n$ make test\n```\n\nTo run the local unit tests and view the unit test code coverage in your local web browser, execute\n\n```sh\n$ make test-coverage-html\n```\n\n### Fuzzing tests\n\nThis library implements [Go fuzzing](https://go.dev/security/fuzz/).\nThe generated fuzzing corpus is stored in [andygrunwald/vdf-fuzzing-corpus](https://github.com/andygrunwald/vdf-fuzzing-corpus/), to avoid blowing up the size of this repository.\n\nTo run fuzzing locally, execute\n\n```sh\n$ make init-fuzzing   # Clone the corpus into testdata/fuzz\n$ make clean-fuzzing  # Clean the local fuzzing cache\n$ make test-fuzzing   # Execute the fuzzing\n```\n\n## Press\n\n* Podcast: [Engineering Kiosk Episode \"#42 Lexer, Parser und Open Source in Counterstrike\" (25th of October 2022, German Software Engineering Podcast)](https://engineeringkiosk.dev/podcast/episode/42-lexer-parser-und-open-source-in-counterstrike/?pk_campaign=github_vdf)\n\n## VDF parser in other languages\n\n* PHP and JavaScript: [rossengeorgiev/vdf-parser](https://github.com/rossengeorgiev/vdf-parser)\n* PHP: [devinwl/keyvalues-php](https://github.com/devinwl/keyvalues-php)\n* PHP: [lukezbihlyj/vdf-parser](https://github.com/lukezbihlyj/vdf-parser)\n* PHP: [EXayer/vdf-converter](https://github.com/EXayer/vdf-converter)\n* C#: [sanmadjack/VDF](https://github.com/sanmadjack/VDF)\n* C#: [shravan2x/Gameloop.Vdf](https://github.com/shravan2x/Gameloop.Vdf)\n* C#: [Indieteur/Steam-Apps-Management-API](https://github.com/Indieteur/Steam-Apps-Management-API)\n* C#: [GerhardvanZyl/Steam-VDF-Converter](https://github.com/GerhardvanZyl/Steam-VDF-Converter)\n* C++: [TinyTinni/ValveFileVDF](https://github.com/TinyTinni/ValveFileVDF)\n* Java: [DHager/hl2parse](https://github.com/DHager/hl2parse)\n* JavaScript [node-steam/vdf](https://github.com/node-steam/vdf)\n* JavaScript: [Corecii/steam-binary-vdf-ts](https://github.com/Corecii/steam-binary-vdf-ts)\n* JavaScript: [RoyalBingBong/vdfplus](https://github.com/RoyalBingBong/vdfplus)\n* JavaScript: [key-values/key-values-ts](https://github.com/key-values/key-values-ts)\n* Python: [ValvePython/vdf](https://github.com/ValvePython/vdf)\n* Python: [gorgitko/valve-keyvalues-python](https://github.com/gorgitko/valve-keyvalues-python)\n* Python: [noriah/PyVDF](https://github.com/noriah/PyVDF)\n* Go: [marshauf/keyvalues](https://github.com/marshauf/keyvalues)\n* Go: [Jleagle/steam-go](https://github.com/Jleagle/steam-go/)\n* Go: [Wakeful-Cloud/vdf](https://github.com/Wakeful-Cloud/vdf)\n* Rust: [LovecraftianHorror/vdf-rs](https://github.com/LovecraftianHorror/vdf-rs)\n* Rust: [Corecii/steam_vdf](https://github.com/Corecii/steam_vdf)\n* Other (VS-Code Extension): [cooolbros/vscode-vdf](https://github.com/cooolbros/vscode-vdf)\n* And some more: [Github search for vdf valve](https://github.com/search?p=1\u0026q=vdf+valve\u0026ref=searchresults\u0026type=Repositories\u0026utf8=%E2%9C%93)\n\n## Inspiration\n\nThe code is inspired by [@benbjohnson](https://github.com/benbjohnson)'s article [Handwritten Parsers \u0026 Lexers in Go](https://blog.gopheracademy.com/advent-2014/parsers-lexers/) and his example [sql-parser](https://github.com/benbjohnson/sql-parser).\nThank you Ben!\n\n## License\n\nThis project is released under the terms of the [MIT license](http://en.wikipedia.org/wiki/MIT_License).\n","funding_links":["https://github.com/sponsors/andygrunwald","https://paypal.me/andygrunwald"],"categories":["Text Processing","Go","文本处理","Recently Updated","Template Engines"],"sub_categories":["Parsers/Encoders/Decoders","解析 器/Encoders/Decoders","[Oct 31, 2024](/content/2024/10/31/README.md)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandygrunwald%2Fvdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandygrunwald%2Fvdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandygrunwald%2Fvdf/lists"}