Skip to main content

Utility for serialization and parsing of Palworld configuration files

Project description

PalConfig

Utilities for parsing, merging, and serializing Palworld PalWorldSettings.ini config files.

This package focuses on:

  • INI ➜ JSON conversion (lossless for values; preserves key order)
  • JSON ➜ INI conversion (emits OptionSettings=(...))
  • Merge: apply an old config onto a new default schema (new keys kept, old values override matching keys)
  • JSON Schema generation from a reference config

Palworld uses an Unreal Engine-ish config format where most server settings live inside a single OptionSettings=(...) tuple. palconfig treats that tuple as the source of truth.


Install

Poetry (recommended)

poetry add palconfig

Editable install (local dev)

poetry install

CLI

Once installed, you get the palconfig command.

Merge old values into new defaults (recommended workflow)

palconfig merge --old Old.ini --new New.ini --out-ini PalWorldSettings.ini --out-json merged.json
  • Output INI contains the new schema + your old tuned values
  • merged.json (optional) includes:
    • merged_option_settings
    • deprecated_or_unknown_from_old (keys that existed only in old)

Convert INI ➜ JSON

palconfig to-json --ini PalWorldSettings.ini --out settings.json

Output JSON shape:

{
  "section": "/Script/Pal.PalGameWorldSettings",
  "option_settings": {
    "ExpRate": 5.0,
    "ServerName": "Tectonix GX S4",
    "CrossplayPlatforms": ["Steam", "Xbox", "PS5", "Mac"]
  },
  "order": ["ExpRate", "ServerName", "CrossplayPlatforms"]
}

Convert JSON ➜ INI

palconfig from-json --json settings.json --out PalWorldSettings.ini

This emits:

  • [/Script/Pal.PalGameWorldSettings]
  • A single OptionSettings=(...) line

Generate JSON Schema (from a reference INI)

palconfig schema --ref-ini NewDefaults.ini --out optionsettings.schema.json

Notes:

  • The schema is generated from the parsed values in the reference file.
  • It is strict about keys: additionalProperties: false
  • Types are inferred (bool/int/float/string/array). Empty lists default to permissive item types.

Library usage

from palconfig.codec import (
    parse_optionsettings,
    serialize_optionsettings,
    merge_old_into_new,
)

old_text = open("Old.ini", "r", encoding="utf-8").read()
new_text = open("New.ini", "r", encoding="utf-8").read()

result = merge_old_into_new(old_text, new_text)

merged_ini = "[/Script/Pal.PalGameWorldSettings]\\n" + serialize_optionsettings(result.merged, order=result.order) + "\\n"
open("PalWorldSettings.ini", "w", encoding="utf-8").write(merged_ini)

print("Deprecated/unknown keys from old:", result.deprecated_or_unknown_from_old)

Parsing rules

palconfig aims to match Palworld’s format as it appears in real configs:

  • Nonenull in JSON
  • True/False ➜ booleans
  • Numbers:
    • 8211 ➜ int
    • 1.000000 ➜ float
  • Quoted strings:
    • ServerName="Default Palworld Server""Default Palworld Server"
  • Tuple lists:
    • CrossplayPlatforms=(Steam,Xbox,PS5,Mac)["Steam","Xbox","PS5","Mac"]
  • Empty assignment:
    • DenyTechnologyList=""

Commas inside quotes and commas inside nested tuples are handled correctly.


Merge behavior

When you run palconfig merge:

  • All NEW keys are present in the merged output.
  • If OLD has the same key, OLD overrides NEW (even if the old value is empty).
  • Keys present only in OLD are captured in deprecated_or_unknown_from_old.

This keeps you aligned with upstream defaults while preserving your custom tuning.


Testing

poetry run pytest

The test suite covers:

  • basic type parsing (None/bool/int/float/string)
  • nested tuple parsing
  • round-trip stability (INI ➜ JSON ➜ INI ➜ JSON)
  • merge semantics + ordering
  • schema generation shape

Practical safety note

Palworld configs often contain credentials (e.g., AdminPassword, ServerPassword). If you're converting configs to JSON and sharing them, redact first — your future self will thank you.


License

MIT

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

palconfig-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

palconfig-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file palconfig-0.1.0.tar.gz.

File metadata

  • Download URL: palconfig-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Linux/6.2.1-PRoot-Distro

File hashes

Hashes for palconfig-0.1.0.tar.gz
Algorithm Hash digest
SHA256 969e5d2c7ec187154ecc6e7a406e44d96d3591c8993bd36251fd2c51b4b0b8ac
MD5 312f747422c2fe25a6151d9da05e7857
BLAKE2b-256 79476fd44dc88a12a7d290646f8e9766e5e174d53ca0fda49cecf81a17f52378

See more details on using hashes here.

File details

Details for the file palconfig-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: palconfig-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Linux/6.2.1-PRoot-Distro

File hashes

Hashes for palconfig-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6cef5938f40fc9f2bf92370a8a980260b0e933544ea15fe0e023e6fd0233f33
MD5 84c7b98876f9ef59280a769a462d41c2
BLAKE2b-256 f72d476440a36580b694fd1cb9ee7a290870e38e75c48668c18fe625f95d3157

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