What is the data format? And how to parse it (python)?

Games using Valve after data format

"name1" { "name2" "value2" "name3" { "name4" "value4" } } 

Does this format have a name or is it created by itself?

Is it possible to parse it in python?

+4
source share
3 answers

I'm not sure that it has a name, but it seems very simple: a node consists of a key and either a value or a set of values, which themselves are either string strings or sets of key-value pairs, It would be trivial to analyze recursively and correctly display the structure of nested python dictionaries.

+1
source

It looks like their own format is called Valve Data Format. The documentation is here , I don't know if there is a parser available in python, but here is the question of parsing it in php

0
source

Similar to JSON, without comma and colon dividers. You can parse it manually, as it has the same logic.

It seems to consist of name-value pairs, so after the name, the search for "{" or another string in "" means the value.

The complex structure of custom classes simplifies management. As Matti John links, there is documentation.

0
source

All Articles