acevo-sdk 0.1.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.
- acevo_sdk-0.1.0/LICENSE +21 -0
- acevo_sdk-0.1.0/PKG-INFO +193 -0
- acevo_sdk-0.1.0/README.md +161 -0
- acevo_sdk-0.1.0/pyproject.toml +67 -0
- acevo_sdk-0.1.0/setup.cfg +4 -0
- acevo_sdk-0.1.0/src/acevo/__init__.py +27 -0
- acevo_sdk-0.1.0/src/acevo/_logging.py +45 -0
- acevo_sdk-0.1.0/src/acevo/capture.py +859 -0
- acevo_sdk-0.1.0/src/acevo/catalogs/__init__.py +9 -0
- acevo_sdk-0.1.0/src/acevo/catalogs/data/track_catalog.json +2604 -0
- acevo_sdk-0.1.0/src/acevo/catalogs/tracks.py +140 -0
- acevo_sdk-0.1.0/src/acevo/constants.py +55 -0
- acevo_sdk-0.1.0/src/acevo/context.py +54 -0
- acevo_sdk-0.1.0/src/acevo/decoder.py +1649 -0
- acevo_sdk-0.1.0/src/acevo/logs.py +1795 -0
- acevo_sdk-0.1.0/src/acevo/models.py +212 -0
- acevo_sdk-0.1.0/src/acevo/shared_session.py +767 -0
- acevo_sdk-0.1.0/src/acevo/tyre_state.py +51 -0
- acevo_sdk-0.1.0/src/acevo_sdk.egg-info/PKG-INFO +193 -0
- acevo_sdk-0.1.0/src/acevo_sdk.egg-info/SOURCES.txt +26 -0
- acevo_sdk-0.1.0/src/acevo_sdk.egg-info/dependency_links.txt +1 -0
- acevo_sdk-0.1.0/src/acevo_sdk.egg-info/requires.txt +7 -0
- acevo_sdk-0.1.0/src/acevo_sdk.egg-info/top_level.txt +1 -0
- acevo_sdk-0.1.0/tests/test_capture.py +13 -0
- acevo_sdk-0.1.0/tests/test_catalogs.py +15 -0
- acevo_sdk-0.1.0/tests/test_decoder.py +26 -0
- acevo_sdk-0.1.0/tests/test_log_parser.py +16 -0
- acevo_sdk-0.1.0/tests/test_public_api.py +31 -0
acevo_sdk-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SimLaps
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
acevo_sdk-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: acevo-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for Assetto Corsa Evo log parsing and shared-memory telemetry.
|
|
5
|
+
Author-email: Gleb Zverinskiy <gleb.zverinskiy@gmail.com>
|
|
6
|
+
Maintainer-email: Gleb Zverinskiy <gleb.zverinskiy@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/glebulon/acevo-sdk
|
|
9
|
+
Project-URL: Issues, https://github.com/glebulon/acevo-sdk/issues
|
|
10
|
+
Project-URL: Source, https://github.com/glebulon/acevo-sdk
|
|
11
|
+
Keywords: assetto-corsa-evo,ace,acevo,sim-racing,telemetry,racing
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Games/Entertainment :: Simulation
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: build>=1.2.0; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
29
|
+
Requires-Dist: ruff>=0.6.0; extra == "dev"
|
|
30
|
+
Requires-Dist: twine>=5.0.0; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# acevo-sdk
|
|
34
|
+
|
|
35
|
+
`acevo-sdk` is a Python SDK for Assetto Corsa Evo log parsing and shared-memory telemetry.
|
|
36
|
+
|
|
37
|
+
It packages the reusable telemetry foundation extracted from SimLaps so other projects can build on ACE data without reimplementing log parsing, binary decoding, or shared-memory capture.
|
|
38
|
+
|
|
39
|
+
This is an independent community SDK. It is not official Kunos Simulazioni or Assetto Corsa software.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install acevo-sdk
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
For local development from this repository:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
python -m pip install -e ".[dev]"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## What It Includes
|
|
54
|
+
|
|
55
|
+
- ACE log parsing for sessions, laps, sectors, validity, player identity, car, track, tyre compound, setup notes, and fuel signals.
|
|
56
|
+
- Live shared-memory capture for ACE physics, graphics, and static regions on Windows.
|
|
57
|
+
- Decoders for captured shared-memory bytes.
|
|
58
|
+
- Reusable dataclasses for laps, sessions, stints, frames, capture metadata, and shared session state.
|
|
59
|
+
- Track catalog helpers and bundled track catalog data.
|
|
60
|
+
|
|
61
|
+
## What It Does Not Include
|
|
62
|
+
|
|
63
|
+
- SimLaps API submission.
|
|
64
|
+
- Discord notifications.
|
|
65
|
+
- Personal-best cache.
|
|
66
|
+
- Desktop UI.
|
|
67
|
+
- Signing, anti-cheat, or server security helpers.
|
|
68
|
+
- HTML telemetry reports, AI prompts, or the larger telemetry analyzer pipeline.
|
|
69
|
+
|
|
70
|
+
Those belong in downstream applications for now.
|
|
71
|
+
|
|
72
|
+
## Use Cases
|
|
73
|
+
|
|
74
|
+
- Build lap-tracking apps like SimLaps that parse ACE logs, detect sessions, laps, sectors, validity, and send structured data to a custom backend.
|
|
75
|
+
- Capture live shared-memory telemetry for dashboards, overlays, stream widgets, engineering tools, or race-control utilities.
|
|
76
|
+
- Decode saved raw shared-memory dumps offline for reverse engineering, debugging, analysis notebooks, or regression tests.
|
|
77
|
+
- Build coaching tools that consume lap, sector, car, track, fuel, tyre, and telemetry signals, while keeping AI/report generation in the downstream app.
|
|
78
|
+
- Create personal data pipelines that export ACE session data to JSONL, SQLite, DuckDB, Parquet, spreadsheets, or analytics services.
|
|
79
|
+
- Build test fixtures and validation tools for ACE telemetry integrations without each project reimplementing log parsing and binary decoding.
|
|
80
|
+
- Prototype future setup/tuning tools on top of stable decoded telemetry and catalog APIs.
|
|
81
|
+
|
|
82
|
+
## Parse Logs
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import asyncio
|
|
86
|
+
from acevo import LogParser
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
async def main():
|
|
90
|
+
parser = LogParser()
|
|
91
|
+
sessions = await parser.parse_file()
|
|
92
|
+
for session in sessions:
|
|
93
|
+
print(session.track, session.car, session.best_lap)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
asyncio.run(main())
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
You can pass a specific log file or directory:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
parser = LogParser(r"C:\Users\you\Saved Games\ACE\Logs")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Capture Shared Memory
|
|
106
|
+
|
|
107
|
+
Live shared-memory capture is Windows-only because ACE exposes telemetry through Win32 file mappings.
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
import asyncio
|
|
111
|
+
from acevo import TelemetryCapture
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
async def main():
|
|
115
|
+
capture = TelemetryCapture(hz=20)
|
|
116
|
+
await capture.start_capture()
|
|
117
|
+
await asyncio.sleep(30)
|
|
118
|
+
frames = await capture.stop_capture()
|
|
119
|
+
print(f"captured {len(frames)} frames")
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
asyncio.run(main())
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
If your application already knows whether the game is running, you can inject a callback:
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
capture = TelemetryCapture(game_running_callback=lambda: True)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
When no callback is provided, the SDK does not enforce game-process detection.
|
|
132
|
+
|
|
133
|
+
## Decode Raw Bytes
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
from pathlib import Path
|
|
137
|
+
from acevo import decode_graphics, decode_static
|
|
138
|
+
|
|
139
|
+
graphics_bytes = bytes.fromhex(Path("graphics_frame.hex").read_text().strip())
|
|
140
|
+
static_bytes = bytes.fromhex(Path("static_frame.hex").read_text().strip())
|
|
141
|
+
|
|
142
|
+
graphics = decode_graphics(graphics_bytes)
|
|
143
|
+
static = decode_static(static_bytes)
|
|
144
|
+
|
|
145
|
+
print(graphics)
|
|
146
|
+
print(static)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Public API
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from acevo import (
|
|
153
|
+
LogParser,
|
|
154
|
+
TelemetryCapture,
|
|
155
|
+
RegionReader,
|
|
156
|
+
FrameData,
|
|
157
|
+
CaptureMetadata,
|
|
158
|
+
decode_physics,
|
|
159
|
+
decode_graphics,
|
|
160
|
+
decode_static,
|
|
161
|
+
LapData,
|
|
162
|
+
SessionData,
|
|
163
|
+
LapState,
|
|
164
|
+
SharedSessionManager,
|
|
165
|
+
)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Status
|
|
169
|
+
|
|
170
|
+
`acevo-sdk` is Alpha software. Version `0.1.0` is the first extracted SDK release, so public APIs may change while real downstream use cases settle.
|
|
171
|
+
|
|
172
|
+
Please report issues at https://github.com/glebulon/acevo-sdk/issues.
|
|
173
|
+
|
|
174
|
+
## Publishing
|
|
175
|
+
|
|
176
|
+
This repo is designed for PyPI Trusted Publishing through GitHub Actions.
|
|
177
|
+
|
|
178
|
+
Release checklist:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
python -m pip install -e ".[dev]"
|
|
182
|
+
ruff check .
|
|
183
|
+
pytest
|
|
184
|
+
python -m build
|
|
185
|
+
git tag v0.1.0
|
|
186
|
+
git push origin v0.1.0
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Create the GitHub Release for `v0.1.0`; the publish workflow uploads the package to PyPI.
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
MIT
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# acevo-sdk
|
|
2
|
+
|
|
3
|
+
`acevo-sdk` is a Python SDK for Assetto Corsa Evo log parsing and shared-memory telemetry.
|
|
4
|
+
|
|
5
|
+
It packages the reusable telemetry foundation extracted from SimLaps so other projects can build on ACE data without reimplementing log parsing, binary decoding, or shared-memory capture.
|
|
6
|
+
|
|
7
|
+
This is an independent community SDK. It is not official Kunos Simulazioni or Assetto Corsa software.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install acevo-sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For local development from this repository:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python -m pip install -e ".[dev]"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## What It Includes
|
|
22
|
+
|
|
23
|
+
- ACE log parsing for sessions, laps, sectors, validity, player identity, car, track, tyre compound, setup notes, and fuel signals.
|
|
24
|
+
- Live shared-memory capture for ACE physics, graphics, and static regions on Windows.
|
|
25
|
+
- Decoders for captured shared-memory bytes.
|
|
26
|
+
- Reusable dataclasses for laps, sessions, stints, frames, capture metadata, and shared session state.
|
|
27
|
+
- Track catalog helpers and bundled track catalog data.
|
|
28
|
+
|
|
29
|
+
## What It Does Not Include
|
|
30
|
+
|
|
31
|
+
- SimLaps API submission.
|
|
32
|
+
- Discord notifications.
|
|
33
|
+
- Personal-best cache.
|
|
34
|
+
- Desktop UI.
|
|
35
|
+
- Signing, anti-cheat, or server security helpers.
|
|
36
|
+
- HTML telemetry reports, AI prompts, or the larger telemetry analyzer pipeline.
|
|
37
|
+
|
|
38
|
+
Those belong in downstream applications for now.
|
|
39
|
+
|
|
40
|
+
## Use Cases
|
|
41
|
+
|
|
42
|
+
- Build lap-tracking apps like SimLaps that parse ACE logs, detect sessions, laps, sectors, validity, and send structured data to a custom backend.
|
|
43
|
+
- Capture live shared-memory telemetry for dashboards, overlays, stream widgets, engineering tools, or race-control utilities.
|
|
44
|
+
- Decode saved raw shared-memory dumps offline for reverse engineering, debugging, analysis notebooks, or regression tests.
|
|
45
|
+
- Build coaching tools that consume lap, sector, car, track, fuel, tyre, and telemetry signals, while keeping AI/report generation in the downstream app.
|
|
46
|
+
- Create personal data pipelines that export ACE session data to JSONL, SQLite, DuckDB, Parquet, spreadsheets, or analytics services.
|
|
47
|
+
- Build test fixtures and validation tools for ACE telemetry integrations without each project reimplementing log parsing and binary decoding.
|
|
48
|
+
- Prototype future setup/tuning tools on top of stable decoded telemetry and catalog APIs.
|
|
49
|
+
|
|
50
|
+
## Parse Logs
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import asyncio
|
|
54
|
+
from acevo import LogParser
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
async def main():
|
|
58
|
+
parser = LogParser()
|
|
59
|
+
sessions = await parser.parse_file()
|
|
60
|
+
for session in sessions:
|
|
61
|
+
print(session.track, session.car, session.best_lap)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
asyncio.run(main())
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
You can pass a specific log file or directory:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
parser = LogParser(r"C:\Users\you\Saved Games\ACE\Logs")
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Capture Shared Memory
|
|
74
|
+
|
|
75
|
+
Live shared-memory capture is Windows-only because ACE exposes telemetry through Win32 file mappings.
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import asyncio
|
|
79
|
+
from acevo import TelemetryCapture
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
async def main():
|
|
83
|
+
capture = TelemetryCapture(hz=20)
|
|
84
|
+
await capture.start_capture()
|
|
85
|
+
await asyncio.sleep(30)
|
|
86
|
+
frames = await capture.stop_capture()
|
|
87
|
+
print(f"captured {len(frames)} frames")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
asyncio.run(main())
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
If your application already knows whether the game is running, you can inject a callback:
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
capture = TelemetryCapture(game_running_callback=lambda: True)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
When no callback is provided, the SDK does not enforce game-process detection.
|
|
100
|
+
|
|
101
|
+
## Decode Raw Bytes
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from pathlib import Path
|
|
105
|
+
from acevo import decode_graphics, decode_static
|
|
106
|
+
|
|
107
|
+
graphics_bytes = bytes.fromhex(Path("graphics_frame.hex").read_text().strip())
|
|
108
|
+
static_bytes = bytes.fromhex(Path("static_frame.hex").read_text().strip())
|
|
109
|
+
|
|
110
|
+
graphics = decode_graphics(graphics_bytes)
|
|
111
|
+
static = decode_static(static_bytes)
|
|
112
|
+
|
|
113
|
+
print(graphics)
|
|
114
|
+
print(static)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Public API
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from acevo import (
|
|
121
|
+
LogParser,
|
|
122
|
+
TelemetryCapture,
|
|
123
|
+
RegionReader,
|
|
124
|
+
FrameData,
|
|
125
|
+
CaptureMetadata,
|
|
126
|
+
decode_physics,
|
|
127
|
+
decode_graphics,
|
|
128
|
+
decode_static,
|
|
129
|
+
LapData,
|
|
130
|
+
SessionData,
|
|
131
|
+
LapState,
|
|
132
|
+
SharedSessionManager,
|
|
133
|
+
)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Status
|
|
137
|
+
|
|
138
|
+
`acevo-sdk` is Alpha software. Version `0.1.0` is the first extracted SDK release, so public APIs may change while real downstream use cases settle.
|
|
139
|
+
|
|
140
|
+
Please report issues at https://github.com/glebulon/acevo-sdk/issues.
|
|
141
|
+
|
|
142
|
+
## Publishing
|
|
143
|
+
|
|
144
|
+
This repo is designed for PyPI Trusted Publishing through GitHub Actions.
|
|
145
|
+
|
|
146
|
+
Release checklist:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
python -m pip install -e ".[dev]"
|
|
150
|
+
ruff check .
|
|
151
|
+
pytest
|
|
152
|
+
python -m build
|
|
153
|
+
git tag v0.1.0
|
|
154
|
+
git push origin v0.1.0
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Create the GitHub Release for `v0.1.0`; the publish workflow uploads the package to PyPI.
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0.3", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "acevo-sdk"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Python SDK for Assetto Corsa Evo log parsing and shared-memory telemetry."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Gleb Zverinskiy", email = "gleb.zverinskiy@gmail.com" }]
|
|
14
|
+
maintainers = [{ name = "Gleb Zverinskiy", email = "gleb.zverinskiy@gmail.com" }]
|
|
15
|
+
keywords = [
|
|
16
|
+
"assetto-corsa-evo",
|
|
17
|
+
"ace",
|
|
18
|
+
"acevo",
|
|
19
|
+
"sim-racing",
|
|
20
|
+
"telemetry",
|
|
21
|
+
"racing",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 3 - Alpha",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"Operating System :: Microsoft :: Windows",
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Programming Language :: Python :: 3.13",
|
|
32
|
+
"Topic :: Games/Entertainment :: Simulation",
|
|
33
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
34
|
+
]
|
|
35
|
+
dependencies = []
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
dev = [
|
|
39
|
+
"build>=1.2.0",
|
|
40
|
+
"pytest>=8.0.0",
|
|
41
|
+
"pytest-asyncio>=0.23.0",
|
|
42
|
+
"ruff>=0.6.0",
|
|
43
|
+
"twine>=5.0.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://github.com/glebulon/acevo-sdk"
|
|
48
|
+
Issues = "https://github.com/glebulon/acevo-sdk/issues"
|
|
49
|
+
Source = "https://github.com/glebulon/acevo-sdk"
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.packages.find]
|
|
52
|
+
where = ["src"]
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.package-data]
|
|
55
|
+
"acevo.catalogs" = ["data/*.json"]
|
|
56
|
+
|
|
57
|
+
[tool.pytest.ini_options]
|
|
58
|
+
testpaths = ["tests"]
|
|
59
|
+
python_files = ["test_*.py"]
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
line-length = 120
|
|
63
|
+
target-version = "py310"
|
|
64
|
+
|
|
65
|
+
[tool.ruff.lint]
|
|
66
|
+
select = ["E", "F", "I", "UP", "B"]
|
|
67
|
+
ignore = ["E501"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Python SDK for Assetto Corsa Evo telemetry and logs."""
|
|
2
|
+
|
|
3
|
+
from .capture import CaptureMetadata, FrameData, RegionReader, TelemetryCapture
|
|
4
|
+
from .decoder import decode_graphics, decode_physics, decode_static
|
|
5
|
+
from .logs import LogParser
|
|
6
|
+
from .models import InProgressLap, LapData, LapState, SessionData, StintData
|
|
7
|
+
from .shared_session import SharedSessionManager
|
|
8
|
+
|
|
9
|
+
__version__ = "0.1.0"
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"__version__",
|
|
13
|
+
"CaptureMetadata",
|
|
14
|
+
"FrameData",
|
|
15
|
+
"RegionReader",
|
|
16
|
+
"TelemetryCapture",
|
|
17
|
+
"decode_graphics",
|
|
18
|
+
"decode_physics",
|
|
19
|
+
"decode_static",
|
|
20
|
+
"LogParser",
|
|
21
|
+
"InProgressLap",
|
|
22
|
+
"LapData",
|
|
23
|
+
"LapState",
|
|
24
|
+
"SessionData",
|
|
25
|
+
"StintData",
|
|
26
|
+
"SharedSessionManager",
|
|
27
|
+
]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Internal logging helpers for acevo-sdk."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from enum import Enum
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Component(Enum):
|
|
11
|
+
"""Component identifiers used in SDK log records."""
|
|
12
|
+
|
|
13
|
+
LOG_PARSER = "LOG_PARSER"
|
|
14
|
+
TELEMETRY = "TELEMETRY"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
_logger = logging.getLogger("acevo")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _log(level: int, component: Component, message: str, **kwargs: Any) -> None:
|
|
21
|
+
if kwargs:
|
|
22
|
+
context = " ".join(f"{key}={value}" for key, value in kwargs.items() if value is not None)
|
|
23
|
+
if context:
|
|
24
|
+
message = f"{message} | {context}"
|
|
25
|
+
_logger.log(level, "[%s] %s", component.value, message)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def log_debug(component: Component, message: str, **kwargs: Any) -> None:
|
|
29
|
+
_log(logging.DEBUG, component, message, **kwargs)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def log_info(component: Component, message: str, **kwargs: Any) -> None:
|
|
33
|
+
_log(logging.INFO, component, message, **kwargs)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def log_warning(component: Component, message: str, **kwargs: Any) -> None:
|
|
37
|
+
_log(logging.WARNING, component, message, **kwargs)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def log_error(component: Component, message: str, **kwargs: Any) -> None:
|
|
41
|
+
_log(logging.ERROR, component, message, **kwargs)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def log_exception(component: Component, message: str, exception: Exception, **kwargs: Any) -> None:
|
|
45
|
+
_logger.exception("[%s] %s | error=%s", component.value, message, exception, extra=kwargs or None)
|