Skip to main content

Python library for parsing the most common Steam file formats.

Project description

Latest version Travis-CI Coverage
Python library for parsing the most common Steam file formats.
The library has a familiar JSON-like interface: load() / loads() for loading the data,
and dump() / dumps() for saving the data back to the file.

Format support

Read

Write

acf

+

+

appinfo.vdf

+

+

Manifest

+

+

Quickstart

steamfiles requires Python 3.3+

Install the latest stable version:

pip install steamfiles

Import a module for your desired format:

# Use one of these, or all at once!
from steamfiles import acf
from steamfiles import appinfo
from steamfiles import manifest

Easily load data, modify it and dump back:

with open('appinfo.vdf', 'rb') as f:
    data = appinfo.load(f)

# Calculate the total size of all apps.
total_size = sum(app['size'] for app in data.values())
print(total_size)

# Downgrade a change number for all apps.
for app in data.values():
    app['change_number'] -= 1

with open('new_appinfo.vdf', 'wb') as f:
    appinfo.dump(data, f)

Caution: all formats are parsed into dict by default, so the order of data is very likely not the same. As I’m not sure how Steam and related tools deal with rearranged data, pass an OrderedDict class to the wrapper parameter if you plan to write data back and use it later:

from collection import OrderedDict
data = acf.load(f, wrapper=OrderedDict)
# works with other formats as well

Documentation

ACF format overview

More in progress…

TODO

  • [✓] ACF support

  • [✓] appinfo.vdf support (Binary VDF)

  • [✓] Manifest support

  • [?] packageinfo.vdf (Another binary VDF)

  • [?] UserGameStats (achievements)

  • [?] Text VDF files (are they actually ACF?)

License

steamfiles is distributed under the terms of the MIT license.

See the bundled LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steamfiles-0.1.3.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file steamfiles-0.1.3.tar.gz.

File metadata

  • Download URL: steamfiles-0.1.3.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for steamfiles-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ac4fe4866481850032f6bf4543387a8ef1b08bfca208919ba37071a4c5a788d4
MD5 359f5ced14433bdb57e74bf935d168f3
BLAKE2b-256 47c0fd94c8dacbe9f3762ddb21e6a52f5042def002f786b5cc5eb873412ad245

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page