libxrk 0.6.0__cp313-cp313-macosx_11_0_arm64.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.
@@ -0,0 +1,234 @@
1
+ Metadata-Version: 2.4
2
+ Name: libxrk
3
+ Version: 0.6.0
4
+ Summary: Library for reading AIM XRK files from AIM automotive data loggers
5
+ License-File: LICENSE
6
+ Author: Christopher Dewan
7
+ Author-email: chris.dewan@m3rlin.net
8
+ Requires-Python: >=3.10
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Cython
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Provides-Extra: dev
21
+ Provides-Extra: test
22
+ Requires-Dist: cython (>=3.0.0)
23
+ Requires-Dist: numpy (>=1.26.0) ; python_version < "3.14"
24
+ Requires-Dist: numpy (>=2.4.0) ; python_version >= "3.14"
25
+ Requires-Dist: parameterized (>=0.9.0) ; extra == "dev"
26
+ Requires-Dist: parameterized (>=0.9.0) ; extra == "test"
27
+ Requires-Dist: pyarrow (>=18.1.0) ; python_version < "3.14"
28
+ Requires-Dist: pyarrow (>=22.0.0) ; python_version >= "3.14"
29
+ Requires-Dist: pytest (>=7.0.0) ; extra == "dev"
30
+ Requires-Dist: pytest (>=7.0.0) ; extra == "test"
31
+ Requires-Dist: setuptools (>=68.0.0) ; extra == "dev"
32
+ Project-URL: Homepage, https://github.com/m3rlin45/libxrk
33
+ Project-URL: Issues, https://github.com/m3rlin45/libxrk/issues
34
+ Project-URL: Repository, https://github.com/m3rlin45/libxrk
35
+ Description-Content-Type: text/markdown
36
+
37
+ # libxrk
38
+
39
+ A Python library for reading AIM XRK and XRZ files from AIM automotive data loggers.
40
+
41
+ ## Features
42
+
43
+ - Read AIM XRK files (raw data logs)
44
+ - Read AIM XRZ files (zlib-compressed XRK files)
45
+ - Parse track data and telemetry channels
46
+ - GPS coordinate conversion and lap detection
47
+ - High-performance Cython implementation
48
+ - Supports Python 3.10 - 3.14
49
+
50
+ ## Installation
51
+
52
+ ### Install from PyPI
53
+
54
+ ```bash
55
+ pip install libxrk
56
+ ```
57
+
58
+ ### Install from Source
59
+
60
+ #### Prerequisites
61
+
62
+ On Ubuntu/Debian:
63
+ ```bash
64
+ sudo apt install build-essential python3-dev
65
+ ```
66
+
67
+ #### Install with Poetry
68
+
69
+ ```bash
70
+ poetry install
71
+ ```
72
+
73
+ The Cython extension will be automatically compiled during installation.
74
+
75
+ ## Usage
76
+
77
+ ```python
78
+ from libxrk import aim_xrk
79
+
80
+ # Read an XRK file
81
+ log = aim_xrk('path/to/file.xrk')
82
+
83
+ # Read an XRZ file (automatically decompressed)
84
+ log = aim_xrk('path/to/file.xrz')
85
+
86
+ # Access channels (each channel is a PyArrow table with 'timecodes' and value columns)
87
+ for channel_name, channel_table in log.channels.items():
88
+ print(f"{channel_name}: {channel_table.num_rows} samples")
89
+
90
+ # Get all channels merged into a single PyArrow table
91
+ # (handles different sample rates with interpolation/forward-fill)
92
+ merged_table = log.get_channels_as_table()
93
+ print(merged_table.column_names)
94
+
95
+ # Convert to pandas DataFrame
96
+ df = merged_table.to_pandas()
97
+
98
+ # Access laps (PyArrow table with 'num', 'start_time', 'end_time' columns)
99
+ print(f"Laps: {log.laps.num_rows}")
100
+ for i in range(log.laps.num_rows):
101
+ lap_num = log.laps.column("num")[i].as_py()
102
+ start = log.laps.column("start_time")[i].as_py()
103
+ end = log.laps.column("end_time")[i].as_py()
104
+ print(f"Lap {lap_num}: {start} - {end}")
105
+
106
+ # Access metadata
107
+ print(log.metadata)
108
+ ```
109
+
110
+ ### Filtering and Resampling
111
+
112
+ ```python
113
+ from libxrk import aim_xrk
114
+
115
+ log = aim_xrk('session.xrk')
116
+
117
+ # Select specific channels
118
+ gps_log = log.select_channels(['GPS Latitude', 'GPS Longitude', 'GPS Speed'])
119
+
120
+ # Filter to a time range (milliseconds, inclusive start, exclusive end)
121
+ segment = log.filter_by_time_range(60000, 120000)
122
+
123
+ # Filter to a specific lap
124
+ lap5 = log.filter_by_lap(5)
125
+
126
+ # Combine filtering and channel selection
127
+ lap5_gps = log.filter_by_lap(5, channel_names=['GPS Latitude', 'GPS Longitude'])
128
+
129
+ # Resample all channels to match a reference channel's timebase
130
+ aligned = log.resample_to_channel('GPS Speed')
131
+
132
+ # Resample to a custom timebase
133
+ import pyarrow as pa
134
+ target = pa.array(range(0, 100000, 100), type=pa.int64()) # 10 Hz
135
+ resampled = log.resample_to_timecodes(target)
136
+
137
+ # Chain operations for analysis workflows
138
+ df = (log
139
+ .filter_by_lap(5)
140
+ .select_channels(['Engine RPM', 'GPS Speed'])
141
+ .resample_to_channel('GPS Speed')
142
+ .get_channels_as_table()
143
+ .to_pandas())
144
+ ```
145
+
146
+ All filtering and resampling methods return new `LogFile` instances (immutable pattern), enabling method chaining for complex analysis workflows.
147
+
148
+ ## Development
149
+
150
+ ### Quick Check
151
+ ```bash
152
+ # Run all quality checks (format check, type check, tests)
153
+ poetry run poe check
154
+ ```
155
+
156
+ ### Code Formatting
157
+
158
+ This project uses [Black](https://black.readthedocs.io/) for code formatting.
159
+
160
+ ```bash
161
+ # Format all Python files
162
+ poetry run black .
163
+ ```
164
+
165
+ ### Type Checking
166
+
167
+ This project uses [mypy](https://mypy.readthedocs.io/) for static type checking.
168
+
169
+ ```bash
170
+ # Run type checker on all Python files
171
+ poetry run mypy .
172
+ ```
173
+
174
+ ### Running Tests
175
+
176
+ This project uses [pytest](https://pytest.org/) for testing.
177
+
178
+ ```bash
179
+ # Run all tests
180
+ poetry run pytest
181
+
182
+ # Run tests with verbose output
183
+ poetry run pytest -v
184
+
185
+ # Run specific test file
186
+ poetry run pytest tests/test_xrk_loading.py
187
+
188
+ # Run tests with coverage
189
+ poetry run pytest --cov=libxrk
190
+ ```
191
+
192
+ ### Testing with Pyodide (WebAssembly)
193
+
194
+ You can test the library in a WebAssembly environment using Pyodide.
195
+ This requires Node.js to be installed.
196
+
197
+ ```bash
198
+ # Build and run tests in Pyodide (installs Emscripten SDK to build/emsdk if needed)
199
+ poetry run poe pyodide-test
200
+ ```
201
+
202
+ Note: Pyodide tests run automatically in CI via GitHub Actions.
203
+
204
+ ### Building
205
+
206
+ ```bash
207
+ # Build CPython wheel and sdist
208
+ poetry build
209
+
210
+ # Build all wheels (CPython, Pyodide/WebAssembly, and sdist)
211
+ poetry run poe build-all
212
+ ```
213
+
214
+ ### Clean Build
215
+
216
+ ```bash
217
+ # Clean all build artifacts and rebuild
218
+ rm -rf build/ dist/ src/libxrk/*.so && poetry install
219
+ ```
220
+
221
+ ## Testing
222
+
223
+ The project includes end-to-end tests that validate XRK and XRZ file loading and parsing.
224
+
225
+ Test files are located in `tests/test_data/` and include real XRK and XRZ files for validation.
226
+
227
+ ## Credits
228
+
229
+ This project incorporates code from [TrackDataAnalysis](https://github.com/racer-coder/TrackDataAnalysis) by Scott Smith, used under the MIT License.
230
+
231
+ ## License
232
+
233
+ MIT License - See LICENSE file for details.
234
+
@@ -0,0 +1,12 @@
1
+ libxrk/gps.py,sha256=WAkYXPdWA4-ETWuzTvYqU8ig0l4pm3MSoRaNz2qrvNQ,17030
2
+ libxrk/aim_xrk.pyx,sha256=hkC1nIBdkxBIkqCMVHvHUEB9nObP0SVhM2QX-oKOVC4,37573
3
+ libxrk/__init__.py,sha256=TZA05GTnBHlxZt0qY3U1lVrbOCMwfUy2A_VIAu9bk0U,848
4
+ libxrk/aim_xrk.pyi,sha256=rvM4jREIdPmK_pWtAI024V8TFNJx1XDGqhBL6Jb1pQo,1159
5
+ libxrk/aim_xrk.cpython-313-darwin.so,sha256=cOJM6jqvvKJ_iCGnzQ8U_YYZdYnXJu9SZa1O6ApoSaY,533712
6
+ libxrk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ libxrk/base.py,sha256=Qz8i066END2bcGjxblKufqNT-MOHJGjQnwKFP9kXnI8,12875
8
+ libxrk/CLAUDE.md,sha256=bzhPZ6H2nOCHL18irkszle7A-0n5za9MkJVO_s8uC7U,2514
9
+ libxrk-0.6.0.dist-info/RECORD,,
10
+ libxrk-0.6.0.dist-info/WHEEL,sha256=DeuNubWKbjO7iFLfcVskJLr2HMK4oKpW3Lf9Trm124s,134
11
+ libxrk-0.6.0.dist-info/METADATA,sha256=E0So3sn_v8_zCD1brhKsIKLOC4FYRbhH9TRF7Ia6PGM,6227
12
+ libxrk-0.6.0.dist-info/licenses/LICENSE,sha256=ID2HgxccQxGGWfIuuyrbNRych2luvUpWqF6Vt1aNWAk,1154
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.3.0
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-macosx_11_0_arm64
5
+ Generator: delocate 0.13.0
6
+
@@ -0,0 +1,25 @@
1
+ MIT License
2
+
3
+ (For components copied from TrackDataAnalysis)
4
+ Copyright (c) 2024 Scott Smith
5
+
6
+ Copyright (c) 2025 Christopher Dewan
7
+
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.