sc2_datasets.replay_data.sc2_replay_data ======================================== .. py:module:: sc2_datasets.replay_data.sc2_replay_data Classes ------- .. autoapisummary:: sc2_datasets.replay_data.sc2_replay_data.AdditionalInformation sc2_datasets.replay_data.sc2_replay_data.SC2ReplayData Module Contents --------------- .. py:class:: AdditionalInformation .. py:attribute:: replaypack_name :type: str | None .. py:attribute:: replaypack_url :type: str | None .. py:attribute:: filename :type: str | None .. py:attribute:: original_filepath :type: str | None .. py:method:: from_dict(d: dict) -> AdditionalInformation :staticmethod: .. py:class:: SC2ReplayData .. py:attribute:: filepath :type: pathlib.Path .. py:attribute:: header :type: sc2_datasets.replay_parser.header.header.Header .. py:attribute:: initData :type: sc2_datasets.replay_parser.init_data.init_data.InitData .. py:attribute:: details :type: sc2_datasets.replay_parser.details.details.Details .. py:attribute:: metadata :type: sc2_datasets.replay_parser.metadata.metadata.Metadata .. py:attribute:: messageEvents :type: list[sc2_datasets.replay_parser.message_events.message_event.MessageEvent] :value: [] .. py:attribute:: gameEvents :type: list[sc2_datasets.replay_parser.game_events.game_event.GameEvent] :value: [] .. py:attribute:: trackerEvents :type: list[sc2_datasets.replay_parser.tracker_events.tracker_event.TrackerEvent] :value: [] .. py:attribute:: toonPlayerDescMap :type: list :value: [] .. py:attribute:: gameEventsErr :type: bool :value: False .. py:attribute:: messageEventsErr :type: bool :value: False .. py:attribute:: trackerEventsErr :type: bool :value: False .. py:attribute:: additionalInformation :type: AdditionalInformation | None :value: None .. py:method:: from_dict(loaded_data: dict, replay_filepath: str) -> SC2ReplayData :staticmethod: .. py:method:: from_file(replay_filepath: pathlib.Path | str) -> SC2ReplayData :staticmethod: Static method returning initialized SC2ReplayData class from a dictionary. This helps with the original JSON parsing. :param replay_filepath: Specifies a filepath to a JSON file containing data from parsed .SC2Replay file. :type replay_filepath: Path | str :returns: Returns an initialized SC2ReplayData object. :rtype: SC2ReplayData .. rubric:: Examples The factory method ``from_file`` assists with initializing a ``SC2ReplayData`` class. All that is required is a known path to the file that should be parsed. >>> replay_data = SC2ReplayData.from_file("test/test_files/single_replay/test_replay.json") >>> assert isinstance(replay_data, SC2ReplayData) .. py:method:: sanitize_events(loaded_data: dict) :staticmethod: .. py:method:: __hash__() -> int Custom hashing function based on the fields that were read from replay. This hashing function returns a result of hash() call on a tuple constructed as follows: (game_duration_loops, game_time_utc, game_map, game_version, player_toon_map_len, player_tuple_toon,) :returns: Returns an int (hash) representation of the SC2ReplayData class. :rtype: int