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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fortnite_replay_parser-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fe2c26badb0b77da21073311f5bd3815b2f186534a5960731a3a919ca9679e |
|
MD5 | 854b038299163cd31f59cc403d050d05 |
|
BLAKE2b-256 | c84eba4640cef295a4d22834cdcbec5c5b1243f8358a99dd12e64684f2c5eb91 |
Hashes for fortnite_replay_parser-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c2fa8a1e6030dbc9118484763f195e02aabcadad0321731d11a05fb8b0efbf8 |
|
MD5 | 35e763d91398a7a1633d58d04ac0a2de |
|
BLAKE2b-256 | 7ec81a2ffbf1bf1e75eca0fcc5750c603de41d87e65c9097ca8792a551cf45ca |