Skip to main content

Minetest player action log parser

Project description

Minetest log parser

Simple parser for Minetest logs. Parses Minetest logs to JSON.

Description

It only asks for player actions on the server, including authorization and events such as digs, places, moves, actives, punched etc.

Using

Simple example reading via generator parsed dicts:

from src.minetest_log_parser.Parser.MinetestLogParser import MinetestLogParser

if __name__ == '__main__':
    input = "./debug.txt"
    minetestParser = MinetestLogParser(input)

    for parsedLog in minetestParser.read():
        playerNames = ['littlePrettyCat', 'Melon', 'Player']
        if parsedLog['name'] in playerNames:
            print(parsedLog)

Example for import logs to JSON:

from src.minetest_log_parser.Parser.MinetestLogParser import MinetestLogParser

if __name__ == '__main__':
    input = "./debug.txt"
    output = "./debug.json"
    minetestParser = MinetestLogParser(input)

    minetestParser.importToJson(output)

Parsed line output examples:

Action:

{"timestamp": 1698474247, "name": "Player", "action": "places node", "meta_action": null, "node": "default:dirt", "count": 1, "coords": null, "type": null, "logType": "action"}

Beowulf auth:

{"timestamp": 1698471091, "name": "Player", "ip": "127.0.0.1", "protocolVersion": "40", "formspecVersion": "4", "lang": "en", "logType": "beowulfAuth"}

Default auth:

{"timestamp": 1698471091, "name": "Player", "ip": "127.0.0.1", "logType": "auth"}

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

minetest_log_parser-0.0.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

minetest_log_parser-0.0.1-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page