Skip to main content

Minimal library intended to parse events in Fortnite replay files.

Project description

Fortnite Replay Parser

Minimal Python library intended to parse events in Fortnite replay files from Chapter 4 Season 1 with backwards compatibility for earlier versions.

Example Usage

Here is an example function that will output match events regarding player eliminations and other statistics to a JSON file in the root directory.

This should help you get started with using the library and collecting data from game replays:

import json
import os
from reader import FortniteReplayReader

from pydantic.json import pydantic_encoder

filename = os.path.join(os.path.dirname(__file__), "your_replay_file.replay")
with FortniteReplayReader(filename) as replay:
    header = replay.header.dict()
    metadata = replay.metadata.dict(exclude={"encryption_key"})

    output = {"header": header, "metadata": metadata, "events": replay.events}
    with open("replay_dump.json", "w") as f:
        json.dump(output, f, indent=4, default=pydantic_encoder)

Credits

Credits to Shiqan for various protocol documentation and developing the original Python implementation. This library is a fork of that project.

Credits to xNocken whose Node library proved to be a great reference in getting started with updating this project.

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

fortnite_replay_parser-0.1.0.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

fortnite_replay_parser-0.1.0-py3-none-any.whl (10.8 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