Skip to main content

A Pythonic wrapper for Valheim Save Tools - manipulate Valheim save files programmatically

Project description

Valheim Save Tools Python API

Python 3.8+ License: MIT Documentation

A Pythonic wrapper for Valheim Save Tools, providing an intuitive API to manipulate Valheim save files programmatically.

Features

File Conversion - Convert between binary formats (.db, .fwl, .fch) and JSON
Global Keys Management - Add, remove, or list global keys (boss defeats, events)
Structure Cleaning - Remove abandoned structures with configurable thresholds
World Reset - Reset world to initial state while preserving progress
Method Chaining - Fluent API for complex operations
Context Manager - Automatic cleanup and resource management

Installation

pip install valheim-save-tools-py

Quick Start

from valheim_save_tools_py import ValheimSaveTools

vst = ValheimSaveTools()

# Convert to JSON and get data
data = vst.to_json("world.db")
print(f"World version: {data['version']}")

# Add boss defeat
vst.add_global_key("world.db", "defeated_eikthyr")

# Clean and reset with method chaining
vst.process("world.db") \
   .clean_structures(threshold=30) \
   .reset_world() \
   .save("cleaned_world.db")

# Context manager for automatic cleanup
with vst.process("world.db") as p:
    p.clean_structures()
    p.reset_world()

Documentation

Common Use Cases

Convert Save Files

# Binary to JSON - returns parsed data
data = vst.to_json("world.db")
print(f"World has {len(data.get('globalKeys', []))} global keys")

# Also save to file
data = vst.to_json("world.db", "backup.json")

# JSON to Binary
vst.from_json("backup.json", "world.db")

Manage Boss Defeats

# List all global keys
keys = vst.list_global_keys("world.db")

# Add boss defeats
vst.add_global_key("world.db", "defeated_eikthyr")
vst.add_global_key("world.db", "defeated_gdking")

Clean Structures

# Clean with default threshold (25)
vst.clean_structures("world.db")

# Clean with custom threshold
vst.clean_structures("world.db", threshold=50)

Requirements

  • Python 3.8 or higher
  • Java 17 or higher (for running the bundled JAR)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

This is a Python wrapper for Valheim Save Tools by kakoen. Big shout-out for creating such a cool tool 🙏.

I encourage you to contribute to the Valheim Save Tools project!

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

valheim_save_tools_py-0.2.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

valheim_save_tools_py-0.2.0-py3-none-any.whl (2.3 MB view details)

Uploaded Python 3

File details

Details for the file valheim_save_tools_py-0.2.0.tar.gz.

File metadata

  • Download URL: valheim_save_tools_py-0.2.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for valheim_save_tools_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b81dfa74ab9107573ab6581e8c4a088c463230da55b712b0c8d05ce92826786
MD5 f5af35af0ad296fb60108db7918bffdf
BLAKE2b-256 e8a7b1db2d6ff9d35381b22d3acac2e844cf5005da21f80ad0ea0be59151c21a

See more details on using hashes here.

File details

Details for the file valheim_save_tools_py-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for valheim_save_tools_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a10b08ec5815cab356ce6a0f9c445a4843e04bcea6d9072de409af7737fc7897
MD5 cf77917cdf54721f0dc8e74617e6c03d
BLAKE2b-256 96faa85410f337d8ccab63614a9dd0351610da2279d598d7c65abdecc5d409e8

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