Skip to content

SatisfactoryTools/DataUtils

Repository files navigation

SatisfactoryTools/DataUtils

This package can parse exported files from Satisfactory to generate info about recipes, items, schematics, etc.

Running the parser

You need to either have Docker installed, or PHP (8.4+).

For docker, you need to build the container once, and then you can just run it:

docker build -t docsParser
docker run --rm docsParser -v "$PWD:/app" [command]

If you want to use it locally, just run it with PHP:

php bin/docsParser [command]

Commands

If you run the app without any arguments, it'll show you list of commands.

You can use help [command] to get info about supported parameters.

Examples

Parse data, export to wiki format, and omit ficsmas data:

php bin/docsParser parse /path/to/docs.json -o /path/to/output/dir -e wiki --no-ficsmas

Using in PHP

If you want to use the parser in your own PHP project, you can add it via composer

composer require SatisfactoryTools/DocsParser

Example usage:

use SFTools\Data\Parser\DocsParser;

$parser = new DocsParser;
$schema = $parser->parse(file_get_contents(__DIR__ . '/docs.json')); // $schema is SFTools\Data\Schema\DocsSchema

// You can also export the schema in format you like
use SFTools\Data\Export\WikiExporter;

$exporter = new WikiExporter;
$output = $exporter->export($schema);

// $output is either string, or array of [filename => file content], in this case WikiExporter creates array

Custom parsing

You can implement SFTools\Data\Export\Exporter interface to define your own format to export. You can also implement SFTools\Data\Transformers\Transformer to add more transformers (they can "fix" wrong datapoints or transform data to different values).

About

PHP library for providing data structure and tools to parse schema

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published