Skip to content

16AA-Milsim/a3s_to_json

Repository files navigation

a3s_to_json

Convert Arma3Sync (.a3s) Java-serialized metadata into a clean JSON document — entirely offline, from local files only.

What it does

  • Reads the five standard .a3s files from a local directory: autoconfig, changelogs, events, serverinfo, sync.
  • Decompresses each gzipped file to a temporary file and parses it via the bundled Java deserializer.
  • Produces a single JSON with top-level keys: autoconf, serverinfo, changelog, sync, events, plus TYPE, VERSION, and AUTHORS.
  • Events include a mods array resolved from the event addonNames map for quick mod visibility.
  • No network access is used; everything reads from local disk.

Requirements

  • Python 3.8+ (tested on 3.12)
  • Java Runtime Environment on PATH (used to run jdeserialize-1.2.jar in the repo root)
  • Python deps: pip install -r requirements.txt

Quick start

  • Command: python Parser.py <path_to_.a3s_dir> <output_json> [--autoconfig] [--serverinfo] [--changelogs] [--sync] [--events] [--debug]
  • Examples (Windows):
    • Parse everything present: python Parser.py "C:\repo\.a3s" "C:\repo\.a3s\Output\repo.json"
    • Parse only events: python Parser.py "C:\repo\.a3s" "C:\repo\.a3s\Output\events.json" --events
    • Enable verbose parse logging: python Parser.py "C:\repo\.a3s" out.json --debug

Flags

  • If no selective flags are provided, all sections are parsed.
  • --autoconfig --serverinfo --changelogs --sync --events — parse only the specified sections (can combine).
  • --debug — show low-level parse messages (including otherwise suppressed "Could not parse" notices).

Output highlights

  • autoconf.URL_CONF — auto-detected URL config object (Http/Https/Ftp/Sftp) from the serialized data.
  • serverinfo.SERVER_INFO — repository stats (files, size, revision, etc.).
  • changelog — changelog instances with expanded addon lists.
  • sync — repository tree as a nested structure.
  • events.EVENTS.<id> — each event with name, description, and mods (flattened addon list).
  • TYPE, VERSION, AUTHORS — metadata for the generated JSON (VERSION=0.9, AUTHORS=["GPT", "Darojax"]).

Troubleshooting

  • Missing modules: run pip install -r requirements.txt.
  • Java not found: install a JRE and ensure java -version works in your shell.
  • Empty/missing sections: confirm the .a3s directory contains autoconfig, changelogs, events, serverinfo, sync.

Development notes

  • Local-only: helper module LocalFile handles temp file extraction.
  • Parsers: autoconfig/, serverinfo/, changelogs/, sync/, events/.
  • Java bridge: JDeserialize/ (invokes jdeserialize-1.2.jar).

License

  • This project is provided under the Unlicense. See LICENSE.

About

Convert arma3sync binary files from the .a3s folder in a mod repo to json

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages