Library for working with Valve's VDF text format
Project description
VDF 3
Pure python module for (de)serialization to and from VDF that works just like json.
VDF is Valve's KeyValue text file format
Supports:
kv1
Installation
Python 3.7 or higher is required
pip install git+https://github.com/ValvePython/vdf
Example usage
For text representation.
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)
For binary representation
d = vdf.binary_loads(vdf_bytes)
b = vdf.binary_dumps(d)
# alternative format - VBKV
d = vdf.binary_loads(vdf_bytes, alt_format=True)
b = vdf.binary_dumps(d, alt_format=True)
# VBKV with header and CRC checking
d = vdf.vbkv_loads(vbkv_bytes)
b = vdf.vbkv_dumps(d)
Using an alternative mapper
d = vdf.loads(vdf_string, mapper=collections.OrderedDict)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vdf3-3.1.1.1.tar.gz.
File metadata
- Download URL: vdf3-3.1.1.1.tar.gz
- Upload date:
- Size: 98.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0b4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a21da4029382687c8ff8db584291d451fe9b6366c3cf154f76aa9e1d52d378
|
|
| MD5 |
f3190de7a073bf13370205350af823ae
|
|
| BLAKE2b-256 |
f3f0f5abf9898f326eea460add27f518f7cfad9388dc1dd314787b6e4e72bb88
|
File details
Details for the file vdf3-3.1.1.1-cp39-cp39-macosx_10_9_x86_64.whl.
File metadata
- Download URL: vdf3-3.1.1.1-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 187.5 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0b4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
811ded59ec53bf729c2106ff1ea696978a10a0fd9a9b017fd21d321e6c4be4de
|
|
| MD5 |
dd4e5b47216682d082ae3963a68aa43a
|
|
| BLAKE2b-256 |
80b90e861e12731fec496170c70421e4511b9287e3e8cf18d6fa107cec54efa9
|