Library for working with Valve's VDF text format
Project description
VDF is Valve’s KeyValue text file format
https://developer.valvesoftware.com/wiki/KeyValues
The module works just like json to convert VDF to a dict, and vise-versa.
Known Issues
order is not preserved due to using dict
there are known files that contain duplicate keys
Install
You can grab the latest release from https://pypi.python.org/pypi/vdf or via pip
pip install vdf
Usage
import vdf
# parsing vdf from file or string
d = vdf.load(open('file.txt'))
d = vdf.loads(vdf_text)
d = vdf.parse(open('file.txt'))
d = vdf.parse(vdf_text)
# dumping dict as vdf to string
vdf_text = vdf.dumps(d)
indented_vdf = vdf.dumps(d, pretty=True)
# dumping dict as vdf to file
vdf.dump(d, open('file2.txt','w'), pretty=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vdf-1.2.tar.gz
(3.5 kB
view details)
File details
Details for the file vdf-1.2.tar.gz.
File metadata
- Download URL: vdf-1.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15ef6030d10e7171482cae4fd4f7566b6d71d5b3d8d9787a55eca592ed7fdeb6
|
|
| MD5 |
97c73af0bea13a4fe65c086fb45c84e2
|
|
| BLAKE2b-256 |
a35a651c55e588387d50a44c8eb3ed66a44573c021d5e64181a86f087d106d8f
|