#parser #valve #serde #serialization #array #object

kv3

kv3 (keyvalues 3) format parser with serde support

2 releases

0.1.1 Nov 18, 2024
0.1.0 Nov 17, 2024

#2022 in Parser implementations

Download history 218/week @ 2024-11-15 37/week @ 2024-11-22 1/week @ 2024-11-29

256 downloads per month

GPL-3.0-only

32KB
760 lines

CI Crates.io Version docs.rs

kv3

A Rust crate for parsing Valve's KeyValues3 (KV3) format.

Overview

kv3 is a Rust library for parsing and serializing the KeyValues3 (KV3) format used by Valve in their games and tools. It allows you to read KV3 files and access their data in a structured way.

Features

  • Parsing: Parsing KV3 Format.
  • Deserialization: Deserialization Serde Support for the KV3 parsing.
  • Serialization: TODO.
  • Support for Header Metadata: TODO.
  • Support for Comments: Handles single-line (//), multi-line (/* ... */), and XML-style (<!-- ... -->) comments.
  • Support for Multiline Strings: Parses multiline strings enclosed in triple double-quotes (""").
  • Handles Various Data Types: Supports booleans, integers, floats, strings, arrays, hex arrays(binary blobs), objects, and null values.
  • Customizable Parsing: Built using the nom parser combinator library for flexibility.

Installation

Add kv3 to your Cargo.toml dependencies:

[dependencies]
kv3 = { version = "0.1.0", features = ["serde"] }

Dependencies

~1.2–2MB
~41K SLoC