Every file inside converters/ should expose exactly one function:
def convert(data): ... return result
and should not open input files or write output files. That responsibility belongs exclusively to runner.py. This keeps every converter consistent and lets the pipeline automatically process any module listed in pipeline.json.
A modular Python-based JSON conversion pipeline designed to transform game data into custom output formats.
Each converter is implemented as an independent module, while a single runner executes the entire pipeline based on a configuration file. This makes it easy to add new converters without modifying the main application.
- Modular converter architecture
- Configurable conversion pipeline
- Supports multiple conversion jobs in one run
- Automatically creates output directories
- UTF-8 support
- GitHub Actions compatible
- Easy to extend with additional converters
.
├── config/
│ └── pipeline.json
├── converters/
│ ├── dbm_table.py
│ ├── DamageAttrIdName.py
│ └── ...
├── input/
│ ├── DbmTable.json
│ ├── DamageAttrIdName.json
│ └── ...
├── output/
├── runner.py
└── README.md
- Python 3.10 or newer
No external dependencies are required.
Run the entire pipeline:
python runner.pyEach configured job will:
- Load its input JSON.
- Execute the specified converter.
- Write the converted data to the configured output file.
Example output:
Finished dbm_table
Finished DamageAttrIdName
The conversion pipeline is defined in:
config/pipeline.json
Example:
{
"jobs": [
{
"module": "dbm_table",
"input": "input/DbmTable.json",
"output": "output/DbmTable.json"
},
{
"module": "DamageAttrIdName",
"input": "input/DamageAttrIdName.json",
"output": "output/DamageAttrIdName.json"
}
]
}Each job contains:
| Field | Description |
|---|---|
module |
Converter module inside converters/ |
input |
Input JSON file |
output |
Output JSON file |
Jobs are executed sequentially in the order they appear.
Each converter must expose a single function named convert.
Example:
def convert(data):
output = {}
for key, value in data.items():
output[key] = value
return outputThe converter:
- receives the parsed JSON object
- performs any required transformation
- returns the converted object
Do not read or write files inside converter modules. File handling is managed entirely by runner.py.
def convert(data):
return {
str(key): value["Name"]
for key, value in data.items()
}- Create a new Python file inside
converters/.
Example:
converters/MyConverter.py
- Implement:
def convert(data):
...
return result- Add a new job to
config/pipeline.json.
{
"module": "MyConverter",
"input": "input/MyData.json",
"output": "output/MyData.json"
}- Run:
python runner.pyThe new converter will automatically be executed.
Converted files are written to the configured output paths.
Output directories are automatically created if they do not already exist.
The project separates responsibilities:
- runner.py handles loading files, executing converters, and writing output.
- Converter modules only transform data.
- pipeline.json controls which conversions are executed.
This separation keeps converters simple, reusable, and easy to maintain.
This project is released under the MIT License.