sprocket-boxcars-py 0.1.15__tar.gz → 0.2.0__tar.gz

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.

Potentially problematic release.


This version of sprocket-boxcars-py might be problematic. Click here for more details.

@@ -0,0 +1,2 @@
1
+ *__pycache__*
2
+ target/
@@ -0,0 +1,435 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.1.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
10
+
11
+ [[package]]
12
+ name = "bitflags"
13
+ version = "1.3.2"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
16
+
17
+ [[package]]
18
+ name = "bitter"
19
+ version = "0.6.1"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "803ffa563b84251ab8856d83d6b891e8d161e7df73806e10f78b35af05ba1a04"
22
+
23
+ [[package]]
24
+ name = "boxcars"
25
+ version = "0.9.9"
26
+ source = "registry+https://github.com/rust-lang/crates.io-index"
27
+ checksum = "0bfa09b0fb56442e8c00a1cbbc0f09f5d07692066cc7b18df0a9a35850f85f3c"
28
+ dependencies = [
29
+ "bitter",
30
+ "encoding_rs",
31
+ "fnv",
32
+ "phf",
33
+ "serde",
34
+ ]
35
+
36
+ [[package]]
37
+ name = "cfg-if"
38
+ version = "1.0.0"
39
+ source = "registry+https://github.com/rust-lang/crates.io-index"
40
+ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
41
+
42
+ [[package]]
43
+ name = "encoding_rs"
44
+ version = "0.8.32"
45
+ source = "registry+https://github.com/rust-lang/crates.io-index"
46
+ checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
47
+ dependencies = [
48
+ "cfg-if",
49
+ ]
50
+
51
+ [[package]]
52
+ name = "fnv"
53
+ version = "1.0.7"
54
+ source = "registry+https://github.com/rust-lang/crates.io-index"
55
+ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
56
+
57
+ [[package]]
58
+ name = "indoc"
59
+ version = "1.0.9"
60
+ source = "registry+https://github.com/rust-lang/crates.io-index"
61
+ checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306"
62
+
63
+ [[package]]
64
+ name = "itoa"
65
+ version = "1.0.6"
66
+ source = "registry+https://github.com/rust-lang/crates.io-index"
67
+ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
68
+
69
+ [[package]]
70
+ name = "libc"
71
+ version = "0.2.141"
72
+ source = "registry+https://github.com/rust-lang/crates.io-index"
73
+ checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
74
+
75
+ [[package]]
76
+ name = "lock_api"
77
+ version = "0.4.9"
78
+ source = "registry+https://github.com/rust-lang/crates.io-index"
79
+ checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
80
+ dependencies = [
81
+ "autocfg",
82
+ "scopeguard",
83
+ ]
84
+
85
+ [[package]]
86
+ name = "memoffset"
87
+ version = "0.8.0"
88
+ source = "registry+https://github.com/rust-lang/crates.io-index"
89
+ checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
90
+ dependencies = [
91
+ "autocfg",
92
+ ]
93
+
94
+ [[package]]
95
+ name = "once_cell"
96
+ version = "1.17.1"
97
+ source = "registry+https://github.com/rust-lang/crates.io-index"
98
+ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
99
+
100
+ [[package]]
101
+ name = "parking_lot"
102
+ version = "0.12.1"
103
+ source = "registry+https://github.com/rust-lang/crates.io-index"
104
+ checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
105
+ dependencies = [
106
+ "lock_api",
107
+ "parking_lot_core",
108
+ ]
109
+
110
+ [[package]]
111
+ name = "parking_lot_core"
112
+ version = "0.9.7"
113
+ source = "registry+https://github.com/rust-lang/crates.io-index"
114
+ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
115
+ dependencies = [
116
+ "cfg-if",
117
+ "libc",
118
+ "redox_syscall",
119
+ "smallvec",
120
+ "windows-sys",
121
+ ]
122
+
123
+ [[package]]
124
+ name = "phf"
125
+ version = "0.11.1"
126
+ source = "registry+https://github.com/rust-lang/crates.io-index"
127
+ checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c"
128
+ dependencies = [
129
+ "phf_macros",
130
+ "phf_shared",
131
+ ]
132
+
133
+ [[package]]
134
+ name = "phf_generator"
135
+ version = "0.11.1"
136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
137
+ checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf"
138
+ dependencies = [
139
+ "phf_shared",
140
+ "rand",
141
+ ]
142
+
143
+ [[package]]
144
+ name = "phf_macros"
145
+ version = "0.11.1"
146
+ source = "registry+https://github.com/rust-lang/crates.io-index"
147
+ checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66"
148
+ dependencies = [
149
+ "phf_generator",
150
+ "phf_shared",
151
+ "proc-macro2",
152
+ "quote",
153
+ "syn 1.0.109",
154
+ ]
155
+
156
+ [[package]]
157
+ name = "phf_shared"
158
+ version = "0.11.1"
159
+ source = "registry+https://github.com/rust-lang/crates.io-index"
160
+ checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676"
161
+ dependencies = [
162
+ "siphasher",
163
+ ]
164
+
165
+ [[package]]
166
+ name = "proc-macro2"
167
+ version = "1.0.56"
168
+ source = "registry+https://github.com/rust-lang/crates.io-index"
169
+ checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
170
+ dependencies = [
171
+ "unicode-ident",
172
+ ]
173
+
174
+ [[package]]
175
+ name = "pyo3"
176
+ version = "0.18.3"
177
+ source = "registry+https://github.com/rust-lang/crates.io-index"
178
+ checksum = "e3b1ac5b3731ba34fdaa9785f8d74d17448cd18f30cf19e0c7e7b1fdb5272109"
179
+ dependencies = [
180
+ "cfg-if",
181
+ "indoc",
182
+ "libc",
183
+ "memoffset",
184
+ "parking_lot",
185
+ "pyo3-build-config",
186
+ "pyo3-ffi",
187
+ "pyo3-macros",
188
+ "unindent",
189
+ ]
190
+
191
+ [[package]]
192
+ name = "pyo3-build-config"
193
+ version = "0.18.3"
194
+ source = "registry+https://github.com/rust-lang/crates.io-index"
195
+ checksum = "9cb946f5ac61bb61a5014924910d936ebd2b23b705f7a4a3c40b05c720b079a3"
196
+ dependencies = [
197
+ "once_cell",
198
+ "target-lexicon",
199
+ ]
200
+
201
+ [[package]]
202
+ name = "pyo3-ffi"
203
+ version = "0.18.3"
204
+ source = "registry+https://github.com/rust-lang/crates.io-index"
205
+ checksum = "fd4d7c5337821916ea2a1d21d1092e8443cf34879e53a0ac653fbb98f44ff65c"
206
+ dependencies = [
207
+ "libc",
208
+ "pyo3-build-config",
209
+ ]
210
+
211
+ [[package]]
212
+ name = "pyo3-macros"
213
+ version = "0.18.3"
214
+ source = "registry+https://github.com/rust-lang/crates.io-index"
215
+ checksum = "a9d39c55dab3fc5a4b25bbd1ac10a2da452c4aca13bb450f22818a002e29648d"
216
+ dependencies = [
217
+ "proc-macro2",
218
+ "pyo3-macros-backend",
219
+ "quote",
220
+ "syn 1.0.109",
221
+ ]
222
+
223
+ [[package]]
224
+ name = "pyo3-macros-backend"
225
+ version = "0.18.3"
226
+ source = "registry+https://github.com/rust-lang/crates.io-index"
227
+ checksum = "97daff08a4c48320587b5224cc98d609e3c27b6d437315bd40b605c98eeb5918"
228
+ dependencies = [
229
+ "proc-macro2",
230
+ "quote",
231
+ "syn 1.0.109",
232
+ ]
233
+
234
+ [[package]]
235
+ name = "quote"
236
+ version = "1.0.26"
237
+ source = "registry+https://github.com/rust-lang/crates.io-index"
238
+ checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
239
+ dependencies = [
240
+ "proc-macro2",
241
+ ]
242
+
243
+ [[package]]
244
+ name = "rand"
245
+ version = "0.8.5"
246
+ source = "registry+https://github.com/rust-lang/crates.io-index"
247
+ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
248
+ dependencies = [
249
+ "rand_core",
250
+ ]
251
+
252
+ [[package]]
253
+ name = "rand_core"
254
+ version = "0.6.4"
255
+ source = "registry+https://github.com/rust-lang/crates.io-index"
256
+ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
257
+
258
+ [[package]]
259
+ name = "redox_syscall"
260
+ version = "0.2.16"
261
+ source = "registry+https://github.com/rust-lang/crates.io-index"
262
+ checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
263
+ dependencies = [
264
+ "bitflags",
265
+ ]
266
+
267
+ [[package]]
268
+ name = "ryu"
269
+ version = "1.0.13"
270
+ source = "registry+https://github.com/rust-lang/crates.io-index"
271
+ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
272
+
273
+ [[package]]
274
+ name = "scopeguard"
275
+ version = "1.1.0"
276
+ source = "registry+https://github.com/rust-lang/crates.io-index"
277
+ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
278
+
279
+ [[package]]
280
+ name = "serde"
281
+ version = "1.0.160"
282
+ source = "registry+https://github.com/rust-lang/crates.io-index"
283
+ checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c"
284
+ dependencies = [
285
+ "serde_derive",
286
+ ]
287
+
288
+ [[package]]
289
+ name = "serde_derive"
290
+ version = "1.0.160"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df"
293
+ dependencies = [
294
+ "proc-macro2",
295
+ "quote",
296
+ "syn 2.0.15",
297
+ ]
298
+
299
+ [[package]]
300
+ name = "serde_json"
301
+ version = "1.0.96"
302
+ source = "registry+https://github.com/rust-lang/crates.io-index"
303
+ checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1"
304
+ dependencies = [
305
+ "itoa",
306
+ "ryu",
307
+ "serde",
308
+ ]
309
+
310
+ [[package]]
311
+ name = "siphasher"
312
+ version = "0.3.10"
313
+ source = "registry+https://github.com/rust-lang/crates.io-index"
314
+ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
315
+
316
+ [[package]]
317
+ name = "smallvec"
318
+ version = "1.10.0"
319
+ source = "registry+https://github.com/rust-lang/crates.io-index"
320
+ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
321
+
322
+ [[package]]
323
+ name = "sprocket-boxcars-py"
324
+ version = "0.2.0"
325
+ dependencies = [
326
+ "boxcars",
327
+ "pyo3",
328
+ "serde_json",
329
+ ]
330
+
331
+ [[package]]
332
+ name = "syn"
333
+ version = "1.0.109"
334
+ source = "registry+https://github.com/rust-lang/crates.io-index"
335
+ checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
336
+ dependencies = [
337
+ "proc-macro2",
338
+ "quote",
339
+ "unicode-ident",
340
+ ]
341
+
342
+ [[package]]
343
+ name = "syn"
344
+ version = "2.0.15"
345
+ source = "registry+https://github.com/rust-lang/crates.io-index"
346
+ checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
347
+ dependencies = [
348
+ "proc-macro2",
349
+ "quote",
350
+ "unicode-ident",
351
+ ]
352
+
353
+ [[package]]
354
+ name = "target-lexicon"
355
+ version = "0.12.6"
356
+ source = "registry+https://github.com/rust-lang/crates.io-index"
357
+ checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
358
+
359
+ [[package]]
360
+ name = "unicode-ident"
361
+ version = "1.0.8"
362
+ source = "registry+https://github.com/rust-lang/crates.io-index"
363
+ checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
364
+
365
+ [[package]]
366
+ name = "unindent"
367
+ version = "0.1.11"
368
+ source = "registry+https://github.com/rust-lang/crates.io-index"
369
+ checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c"
370
+
371
+ [[package]]
372
+ name = "windows-sys"
373
+ version = "0.45.0"
374
+ source = "registry+https://github.com/rust-lang/crates.io-index"
375
+ checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
376
+ dependencies = [
377
+ "windows-targets",
378
+ ]
379
+
380
+ [[package]]
381
+ name = "windows-targets"
382
+ version = "0.42.2"
383
+ source = "registry+https://github.com/rust-lang/crates.io-index"
384
+ checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
385
+ dependencies = [
386
+ "windows_aarch64_gnullvm",
387
+ "windows_aarch64_msvc",
388
+ "windows_i686_gnu",
389
+ "windows_i686_msvc",
390
+ "windows_x86_64_gnu",
391
+ "windows_x86_64_gnullvm",
392
+ "windows_x86_64_msvc",
393
+ ]
394
+
395
+ [[package]]
396
+ name = "windows_aarch64_gnullvm"
397
+ version = "0.42.2"
398
+ source = "registry+https://github.com/rust-lang/crates.io-index"
399
+ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
400
+
401
+ [[package]]
402
+ name = "windows_aarch64_msvc"
403
+ version = "0.42.2"
404
+ source = "registry+https://github.com/rust-lang/crates.io-index"
405
+ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
406
+
407
+ [[package]]
408
+ name = "windows_i686_gnu"
409
+ version = "0.42.2"
410
+ source = "registry+https://github.com/rust-lang/crates.io-index"
411
+ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
412
+
413
+ [[package]]
414
+ name = "windows_i686_msvc"
415
+ version = "0.42.2"
416
+ source = "registry+https://github.com/rust-lang/crates.io-index"
417
+ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
418
+
419
+ [[package]]
420
+ name = "windows_x86_64_gnu"
421
+ version = "0.42.2"
422
+ source = "registry+https://github.com/rust-lang/crates.io-index"
423
+ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
424
+
425
+ [[package]]
426
+ name = "windows_x86_64_gnullvm"
427
+ version = "0.42.2"
428
+ source = "registry+https://github.com/rust-lang/crates.io-index"
429
+ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
430
+
431
+ [[package]]
432
+ name = "windows_x86_64_msvc"
433
+ version = "0.42.2"
434
+ source = "registry+https://github.com/rust-lang/crates.io-index"
435
+ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
@@ -0,0 +1,19 @@
1
+ [package]
2
+ name = "sprocket-boxcars-py"
3
+ version = "0.2.0"
4
+ edition = "2021"
5
+ description = "Python bindings for the Rocket League replay parser boxcars."
6
+ authors = ["Jake Bailey <asaxplayinghorse@gmail.com>"]
7
+ license = "MIT"
8
+ readme = "README.md"
9
+ repository = "https://github.com/SprocketBot/boxcars-py"
10
+
11
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
12
+ [lib]
13
+ name = "sprocket_boxcars_py"
14
+ crate-type = ["cdylib"]
15
+
16
+ [dependencies]
17
+ boxcars = "0.9.4"
18
+ serde_json = "1.0.52"
19
+ pyo3 = "0.18.1"
@@ -1,4 +1,4 @@
1
- Copyright (c) 2020 Justus K
1
+ Copyright (c) 2023 Jake Bailey
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.1
2
+ Name: sprocket-boxcars-py
3
+ Version: 0.2.0
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
7
+ License-File: LICENSE
8
+ Summary: Python bindings for the Rocket League replay parser boxcars.
9
+ Author: Jake Bailey <asaxplayinghorse@gmail.com>
10
+ Author-email: Jake Bailey <asaxplayinghorse@gmail.com>
11
+ License: MIT
12
+ Requires-Python: >=3.7
13
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
14
+ Project-URL: Source Code, https://github.com/SprocketBot/boxcars-py
15
+
16
+ # Boxcars-py
17
+
18
+ Python bindings for the [Boxcars](https://github.com/nickbabcock/boxcars) Rocket
19
+ League replay parser. This is a fork of [SaltieRL's
20
+ package](https://github.com/SaltieRL/boxcars-py) which sadly seems to no longer
21
+ be maintained.
22
+
23
+ ## Installation
24
+
25
+ Only tested on linux.
26
+ You have to compile it yourself if you are using Windows.
27
+
28
+ ```
29
+ pip install sprocket-boxcars-py
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```py
35
+ from boxcars_py import parse_replay
36
+
37
+ with open("your_replay.replay", "rb") as f:
38
+ buf = f.read()
39
+ f.close()
40
+
41
+ replay = parse_replay(buf)
42
+ # Use the parsed replay here
43
+ ```
44
+
45
+ ## Building from source
46
+
47
+ __Requirements__
48
+ - Rust.
49
+ - `maturin`
50
+
51
+ ```
52
+ maturin develop
53
+ maturin publish
54
+ ```
55
+
@@ -11,7 +11,7 @@ Only tested on linux.
11
11
  You have to compile it yourself if you are using Windows.
12
12
 
13
13
  ```
14
- pip install boxcars-py
14
+ pip install sprocket-boxcars-py
15
15
  ```
16
16
 
17
17
  ## Usage
@@ -31,11 +31,9 @@ replay = parse_replay(buf)
31
31
 
32
32
  __Requirements__
33
33
  - Rust.
34
- - [poetry](https://pypi.org/project/poetry/)
34
+ - `maturin`
35
35
 
36
36
  ```
37
- # Install dependencies
38
- poetry install
39
- # Build
40
- make
37
+ maturin develop
38
+ maturin publish
41
39
  ```
@@ -0,0 +1,16 @@
1
+ [build-system]
2
+ requires = ["maturin>=0.14,<0.15"]
3
+ build-backend = "maturin"
4
+
5
+ [project]
6
+ name = "sprocket-boxcars-py"
7
+ requires-python = ">=3.7"
8
+ classifiers = [
9
+ "Programming Language :: Rust",
10
+ "Programming Language :: Python :: Implementation :: CPython",
11
+ "Programming Language :: Python :: Implementation :: PyPy",
12
+ ]
13
+
14
+
15
+ [tool.maturin]
16
+ features = ["pyo3/extension-module"]
@@ -0,0 +1,53 @@
1
+ use boxcars::NetworkParse;
2
+ use pyo3::prelude::*;
3
+ use pyo3::{exceptions, wrap_pyfunction};
4
+ use serde_json::Value;
5
+ use std::collections::BTreeMap;
6
+
7
+ #[pyfunction]
8
+ fn parse_replay<'p>(py: Python<'p>, data: &[u8]) -> PyResult<PyObject> {
9
+ let replay = boxcars::ParserBuilder::new(data)
10
+ // .must_parse_network_data()
11
+ .with_network_parse(NetworkParse::Always)
12
+ .on_error_check_crc()
13
+ .parse()
14
+ .map_err(to_py_error)?;
15
+ let replay = serde_json::to_value(replay).map_err(to_py_error)?;
16
+ let replay = convert_to_py(py, &replay);
17
+ Ok(replay)
18
+ }
19
+
20
+ #[pymodule]
21
+ fn sprocket_boxcars_py(_py: Python, m: &PyModule) -> PyResult<()> {
22
+ m.add_wrapped(wrap_pyfunction!(parse_replay))?;
23
+ Ok(())
24
+ }
25
+
26
+ fn to_py_error<E: std::error::Error>(e: E) -> PyErr {
27
+ PyErr::new::<exceptions::PyException, _>(format!("{}", e))
28
+ }
29
+
30
+ fn convert_to_py(py: Python, value: &Value) -> PyObject {
31
+ match value {
32
+ Value::Null => py.None(),
33
+ Value::Bool(b) => b.into_py(py),
34
+ Value::Number(n) => match n {
35
+ n if n.is_u64() => n.as_u64().unwrap().into_py(py),
36
+ n if n.is_i64() => n.as_i64().unwrap().into_py(py),
37
+ n if n.is_f64() => n.as_f64().unwrap().into_py(py),
38
+ _ => py.None(),
39
+ },
40
+ Value::String(s) => s.into_py(py),
41
+ Value::Array(list) => {
42
+ let list: Vec<PyObject> = list.iter().map(|e| convert_to_py(py, e)).collect();
43
+ list.into_py(py)
44
+ }
45
+ Value::Object(m) => {
46
+ let mut map = BTreeMap::new();
47
+ m.iter().for_each(|(k, v)| {
48
+ map.insert(k, convert_to_py(py, v));
49
+ });
50
+ map.into_py(py)
51
+ }
52
+ }
53
+ }
@@ -1,62 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: sprocket-boxcars-py
3
- Version: 0.1.15
4
- Summary: Python bindings for the Rocket League replay parser boxcars.
5
- Home-page: https://github.com/SprocketBot/boxcars-py
6
- License: MIT
7
- Author: Jake Bailey
8
- Author-email: asaxplayinghorse@gmail.com
9
- Requires-Python: >=3.6,<4.0
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.6
13
- Classifier: Programming Language :: Python :: 3.7
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Project-URL: Repository, https://github.com/SprocketBot/boxcars-py
19
- Description-Content-Type: text/markdown
20
-
21
- # Boxcars-py
22
-
23
- Python bindings for the [Boxcars](https://github.com/nickbabcock/boxcars) Rocket
24
- League replay parser. This is a fork of [SaltieRL's
25
- package](https://github.com/SaltieRL/boxcars-py) which sadly seems to no longer
26
- be maintained.
27
-
28
- ## Installation
29
-
30
- Only tested on linux.
31
- You have to compile it yourself if you are using Windows.
32
-
33
- ```
34
- pip install boxcars-py
35
- ```
36
-
37
- ## Usage
38
-
39
- ```py
40
- from boxcars_py import parse_replay
41
-
42
- with open("your_replay.replay", "rb") as f:
43
- buf = f.read()
44
- f.close()
45
-
46
- replay = parse_replay(buf)
47
- # Use the parsed replay here
48
- ```
49
-
50
- ## Building from source
51
-
52
- __Requirements__
53
- - Rust.
54
- - [poetry](https://pypi.org/project/poetry/)
55
-
56
- ```
57
- # Install dependencies
58
- poetry install
59
- # Build
60
- make
61
- ```
62
-
@@ -1,18 +0,0 @@
1
- [tool.poetry]
2
- name = "sprocket_boxcars_py"
3
- version = "0.1.15"
4
- description = "Python bindings for the Rocket League replay parser boxcars."
5
- authors = ["Jake Bailey <asaxplayinghorse@gmail.com>"]
6
- license = "MIT"
7
- readme = "README.md"
8
- repository = "https://github.com/SprocketBot/boxcars-py"
9
-
10
- [tool.poetry.dependencies]
11
- python = "^3.6"
12
-
13
- [tool.poetry.dev-dependencies]
14
- pytest = "^3.5"
15
- wheel = "*"
16
- pytest-runner = "*"
17
- pytest-benchmark = "3.2.3"
18
- maturin = "0.7.7"
@@ -1 +0,0 @@
1
- from .sprocket_boxcars_py import parse_replay