python-manta 1.4.5.3__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_manta/__init__.py +159 -0
- python_manta/libmanta_wrapper.h +139 -0
- python_manta/libmanta_wrapper.so +0 -0
- python_manta/manta_python.py +2332 -0
- python_manta-1.4.5.3.dist-info/METADATA +1432 -0
- python_manta-1.4.5.3.dist-info/RECORD +8 -0
- python_manta-1.4.5.3.dist-info/WHEEL +5 -0
- python_manta-1.4.5.3.dist-info/top_level.txt +1 -0
python_manta/__init__.py
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Python Manta - Python interface for the Manta Dota 2 replay parser
|
|
3
|
+
|
|
4
|
+
This package provides a Python wrapper for the dotabuff/manta Go library,
|
|
5
|
+
enabling parsing of modern Dota 2 replay files (.dem) from Python applications.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
from python_manta import Parser
|
|
9
|
+
|
|
10
|
+
parser = Parser("replay.dem")
|
|
11
|
+
result = parser.parse(header=True)
|
|
12
|
+
print(f"Map: {result.header.map_name}, Build: {result.header.build_num}")
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from .manta_python import (
|
|
16
|
+
# Main parser class
|
|
17
|
+
Parser,
|
|
18
|
+
# V2 config/result types
|
|
19
|
+
ParseConfig,
|
|
20
|
+
ParseResult,
|
|
21
|
+
# V2 streaming types
|
|
22
|
+
StreamConfig,
|
|
23
|
+
StreamEvent,
|
|
24
|
+
StreamResult,
|
|
25
|
+
# V2 index/seek types
|
|
26
|
+
Keyframe,
|
|
27
|
+
DemoIndex,
|
|
28
|
+
AbilitySnapshot,
|
|
29
|
+
TalentChoice,
|
|
30
|
+
HeroSnapshot,
|
|
31
|
+
EntityStateSnapshot,
|
|
32
|
+
RangeParseConfig,
|
|
33
|
+
RangeParseResult,
|
|
34
|
+
KeyframeResult,
|
|
35
|
+
# Enums
|
|
36
|
+
RuneType,
|
|
37
|
+
EntityType,
|
|
38
|
+
CombatLogType,
|
|
39
|
+
DamageType,
|
|
40
|
+
Team,
|
|
41
|
+
Hero,
|
|
42
|
+
NeutralCampType,
|
|
43
|
+
NeutralItemTier,
|
|
44
|
+
NeutralItem,
|
|
45
|
+
ChatWheelMessage,
|
|
46
|
+
GameActivity,
|
|
47
|
+
# Header model
|
|
48
|
+
HeaderInfo,
|
|
49
|
+
# Game info models
|
|
50
|
+
DraftEvent,
|
|
51
|
+
PlayerInfo,
|
|
52
|
+
GameInfo,
|
|
53
|
+
# Universal parsing (low-level API) / Messages collector
|
|
54
|
+
MessageEvent,
|
|
55
|
+
MessagesResult,
|
|
56
|
+
UniversalParseResult,
|
|
57
|
+
# Entity state snapshots
|
|
58
|
+
TeamState,
|
|
59
|
+
EntitySnapshot,
|
|
60
|
+
EntityParseConfig,
|
|
61
|
+
EntityParseResult,
|
|
62
|
+
# Game events
|
|
63
|
+
GameEventData,
|
|
64
|
+
GameEventsConfig,
|
|
65
|
+
GameEventsResult,
|
|
66
|
+
# Modifiers/buffs
|
|
67
|
+
ModifierEntry,
|
|
68
|
+
ModifiersConfig,
|
|
69
|
+
ModifiersResult,
|
|
70
|
+
# Entity query
|
|
71
|
+
EntityData,
|
|
72
|
+
EntitiesConfig,
|
|
73
|
+
EntitiesResult,
|
|
74
|
+
# String tables
|
|
75
|
+
StringTableData,
|
|
76
|
+
StringTablesConfig,
|
|
77
|
+
StringTablesResult,
|
|
78
|
+
# Combat log
|
|
79
|
+
CombatLogEntry,
|
|
80
|
+
CombatLogConfig,
|
|
81
|
+
CombatLogResult,
|
|
82
|
+
# Parser info
|
|
83
|
+
ParserInfo,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
__version__ = "1.4.5.2"
|
|
87
|
+
__author__ = "Equilibrium Coach Team"
|
|
88
|
+
__description__ = "Python interface for Manta Dota 2 replay parser"
|
|
89
|
+
|
|
90
|
+
__all__ = [
|
|
91
|
+
# Main parser class
|
|
92
|
+
"Parser",
|
|
93
|
+
# V2 config/result types
|
|
94
|
+
"ParseConfig",
|
|
95
|
+
"ParseResult",
|
|
96
|
+
# V2 streaming types
|
|
97
|
+
"StreamConfig",
|
|
98
|
+
"StreamEvent",
|
|
99
|
+
"StreamResult",
|
|
100
|
+
# V2 index/seek types
|
|
101
|
+
"Keyframe",
|
|
102
|
+
"DemoIndex",
|
|
103
|
+
"AbilitySnapshot",
|
|
104
|
+
"TalentChoice",
|
|
105
|
+
"HeroSnapshot",
|
|
106
|
+
"EntityStateSnapshot",
|
|
107
|
+
"RangeParseConfig",
|
|
108
|
+
"RangeParseResult",
|
|
109
|
+
"KeyframeResult",
|
|
110
|
+
# Enums
|
|
111
|
+
"RuneType",
|
|
112
|
+
"EntityType",
|
|
113
|
+
"CombatLogType",
|
|
114
|
+
"DamageType",
|
|
115
|
+
"Team",
|
|
116
|
+
"Hero",
|
|
117
|
+
"NeutralCampType",
|
|
118
|
+
"NeutralItemTier",
|
|
119
|
+
"NeutralItem",
|
|
120
|
+
"ChatWheelMessage",
|
|
121
|
+
"GameActivity",
|
|
122
|
+
# Header model
|
|
123
|
+
"HeaderInfo",
|
|
124
|
+
# Game info models
|
|
125
|
+
"DraftEvent",
|
|
126
|
+
"PlayerInfo",
|
|
127
|
+
"GameInfo",
|
|
128
|
+
# Universal parsing (low-level API) / Messages collector
|
|
129
|
+
"MessageEvent",
|
|
130
|
+
"MessagesResult",
|
|
131
|
+
"UniversalParseResult",
|
|
132
|
+
# Entity state snapshots
|
|
133
|
+
"TeamState",
|
|
134
|
+
"EntitySnapshot",
|
|
135
|
+
"EntityParseConfig",
|
|
136
|
+
"EntityParseResult",
|
|
137
|
+
# Game events
|
|
138
|
+
"GameEventData",
|
|
139
|
+
"GameEventsConfig",
|
|
140
|
+
"GameEventsResult",
|
|
141
|
+
# Modifiers/buffs
|
|
142
|
+
"ModifierEntry",
|
|
143
|
+
"ModifiersConfig",
|
|
144
|
+
"ModifiersResult",
|
|
145
|
+
# Entity query
|
|
146
|
+
"EntityData",
|
|
147
|
+
"EntitiesConfig",
|
|
148
|
+
"EntitiesResult",
|
|
149
|
+
# String tables
|
|
150
|
+
"StringTableData",
|
|
151
|
+
"StringTablesConfig",
|
|
152
|
+
"StringTablesResult",
|
|
153
|
+
# Combat log
|
|
154
|
+
"CombatLogEntry",
|
|
155
|
+
"CombatLogConfig",
|
|
156
|
+
"CombatLogResult",
|
|
157
|
+
# Parser info
|
|
158
|
+
"ParserInfo",
|
|
159
|
+
]
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
|
2
|
+
|
|
3
|
+
/* package manta_wrapper */
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
#line 1 "cgo-builtin-export-prolog"
|
|
7
|
+
|
|
8
|
+
#include <stddef.h>
|
|
9
|
+
|
|
10
|
+
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
|
11
|
+
#define GO_CGO_EXPORT_PROLOGUE_H
|
|
12
|
+
|
|
13
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
14
|
+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
/* Start of preamble from import "C" comments. */
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
#line 3 "data_parser.go"
|
|
23
|
+
|
|
24
|
+
#include <stdlib.h>
|
|
25
|
+
|
|
26
|
+
#line 1 "cgo-generated-wrapper"
|
|
27
|
+
|
|
28
|
+
#line 3 "entity_parser.go"
|
|
29
|
+
|
|
30
|
+
#include <stdlib.h>
|
|
31
|
+
|
|
32
|
+
#line 1 "cgo-generated-wrapper"
|
|
33
|
+
|
|
34
|
+
#line 3 "index.go"
|
|
35
|
+
|
|
36
|
+
#include <stdlib.h>
|
|
37
|
+
|
|
38
|
+
#line 1 "cgo-generated-wrapper"
|
|
39
|
+
|
|
40
|
+
#line 3 "manta_wrapper.go"
|
|
41
|
+
|
|
42
|
+
#include <stdlib.h>
|
|
43
|
+
|
|
44
|
+
#line 1 "cgo-generated-wrapper"
|
|
45
|
+
|
|
46
|
+
#line 3 "parser.go"
|
|
47
|
+
|
|
48
|
+
#include <stdlib.h>
|
|
49
|
+
|
|
50
|
+
#line 1 "cgo-generated-wrapper"
|
|
51
|
+
|
|
52
|
+
#line 3 "stream.go"
|
|
53
|
+
|
|
54
|
+
#include <stdlib.h>
|
|
55
|
+
|
|
56
|
+
#line 1 "cgo-generated-wrapper"
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
/* End of preamble from import "C" comments. */
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/* Start of boilerplate cgo prologue. */
|
|
64
|
+
#line 1 "cgo-gcc-export-header-prolog"
|
|
65
|
+
|
|
66
|
+
#ifndef GO_CGO_PROLOGUE_H
|
|
67
|
+
#define GO_CGO_PROLOGUE_H
|
|
68
|
+
|
|
69
|
+
typedef signed char GoInt8;
|
|
70
|
+
typedef unsigned char GoUint8;
|
|
71
|
+
typedef short GoInt16;
|
|
72
|
+
typedef unsigned short GoUint16;
|
|
73
|
+
typedef int GoInt32;
|
|
74
|
+
typedef unsigned int GoUint32;
|
|
75
|
+
typedef long long GoInt64;
|
|
76
|
+
typedef unsigned long long GoUint64;
|
|
77
|
+
typedef GoInt64 GoInt;
|
|
78
|
+
typedef GoUint64 GoUint;
|
|
79
|
+
typedef size_t GoUintptr;
|
|
80
|
+
typedef float GoFloat32;
|
|
81
|
+
typedef double GoFloat64;
|
|
82
|
+
#ifdef _MSC_VER
|
|
83
|
+
#include <complex.h>
|
|
84
|
+
typedef _Fcomplex GoComplex64;
|
|
85
|
+
typedef _Dcomplex GoComplex128;
|
|
86
|
+
#else
|
|
87
|
+
typedef float _Complex GoComplex64;
|
|
88
|
+
typedef double _Complex GoComplex128;
|
|
89
|
+
#endif
|
|
90
|
+
|
|
91
|
+
/*
|
|
92
|
+
static assertion to make sure the file is being used on architecture
|
|
93
|
+
at least with matching size of GoInt.
|
|
94
|
+
*/
|
|
95
|
+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
|
96
|
+
|
|
97
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
98
|
+
typedef _GoString_ GoString;
|
|
99
|
+
#endif
|
|
100
|
+
typedef void *GoMap;
|
|
101
|
+
typedef void *GoChan;
|
|
102
|
+
typedef struct { void *t; void *v; } GoInterface;
|
|
103
|
+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
|
104
|
+
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
/* End of boilerplate cgo prologue. */
|
|
108
|
+
|
|
109
|
+
#ifdef __cplusplus
|
|
110
|
+
extern "C" {
|
|
111
|
+
#endif
|
|
112
|
+
|
|
113
|
+
extern __declspec(dllexport) char* ParseGameEvents(char* filePath, char* configJSON);
|
|
114
|
+
extern __declspec(dllexport) char* ParseModifiers(char* filePath, char* configJSON);
|
|
115
|
+
extern __declspec(dllexport) char* QueryEntities(char* filePath, char* configJSON);
|
|
116
|
+
extern __declspec(dllexport) char* GetStringTables(char* filePath, char* configJSON);
|
|
117
|
+
extern __declspec(dllexport) char* ParseCombatLog(char* filePath, char* configJSON);
|
|
118
|
+
extern __declspec(dllexport) char* GetParserInfo(char* filePath);
|
|
119
|
+
extern __declspec(dllexport) char* ParseEntities(char* filePath, char* configJSON);
|
|
120
|
+
extern __declspec(dllexport) char* BuildIndex(char* filePath, int intervalTicks);
|
|
121
|
+
extern __declspec(dllexport) char* GetSnapshot(char* filePath, char* configJSON);
|
|
122
|
+
extern __declspec(dllexport) char* ParseRange(char* filePath, char* configJSON);
|
|
123
|
+
extern __declspec(dllexport) char* FindKeyframe(char* indexJSON, int targetTick);
|
|
124
|
+
extern __declspec(dllexport) char* ParseHeader(char* filePath);
|
|
125
|
+
extern __declspec(dllexport) char* ParseMatchInfo(char* filePath);
|
|
126
|
+
extern __declspec(dllexport) void FreeString(char* str);
|
|
127
|
+
|
|
128
|
+
// Parse executes a single-pass parse with multiple collectors.
|
|
129
|
+
// This is the main entry point for the v2 API.
|
|
130
|
+
//
|
|
131
|
+
extern __declspec(dllexport) char* Parse(char* filePath, char* configJSON);
|
|
132
|
+
extern __declspec(dllexport) char* StreamOpen(char* filePath, char* configJSON);
|
|
133
|
+
extern __declspec(dllexport) char* StreamNext(long long int handleID);
|
|
134
|
+
extern __declspec(dllexport) char* StreamClose(long long int handleID);
|
|
135
|
+
extern __declspec(dllexport) char* ParseUniversal(char* filePath, char* messageFilter, int maxMessages);
|
|
136
|
+
|
|
137
|
+
#ifdef __cplusplus
|
|
138
|
+
}
|
|
139
|
+
#endif
|
|
Binary file
|