bdo-toolkit 1.0.0__py3-none-any.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.
Files changed (48) hide show
  1. bdo_toolkit/__init__.py +87 -0
  2. bdo_toolkit/_async_sessions.py +651 -0
  3. bdo_toolkit/_capture_backend.py +194 -0
  4. bdo_toolkit/_capture_options.py +68 -0
  5. bdo_toolkit/_capture_runtime.py +626 -0
  6. bdo_toolkit/_deposit_origin.py +1599 -0
  7. bdo_toolkit/_engine.py +327 -0
  8. bdo_toolkit/_framing.py +904 -0
  9. bdo_toolkit/_profile_runtime.py +157 -0
  10. bdo_toolkit/_protocol.py +386 -0
  11. bdo_toolkit/_reassembly.py +654 -0
  12. bdo_toolkit/_specs.py +285 -0
  13. bdo_toolkit/_storage_destination_validation.py +167 -0
  14. bdo_toolkit/_storage_hydration.py +241 -0
  15. bdo_toolkit/_version.py +3 -0
  16. bdo_toolkit/calibration.py +3223 -0
  17. bdo_toolkit/capture.py +1713 -0
  18. bdo_toolkit/character_state.py +3506 -0
  19. bdo_toolkit/cli.py +948 -0
  20. bdo_toolkit/diagnostics.py +51 -0
  21. bdo_toolkit/events.py +214 -0
  22. bdo_toolkit/filters.py +105 -0
  23. bdo_toolkit/item_state.py +48 -0
  24. bdo_toolkit/origin_learning.py +779 -0
  25. bdo_toolkit/profiles.py +370 -0
  26. bdo_toolkit/py.typed +1 -0
  27. bdo_toolkit/remote_profiles.py +358 -0
  28. bdo_toolkit/solare/__init__.py +50 -0
  29. bdo_toolkit/solare/_constants.py +94 -0
  30. bdo_toolkit/solare/_detail_learning.py +1437 -0
  31. bdo_toolkit/solare/_details.py +796 -0
  32. bdo_toolkit/solare/_discovery.py +1212 -0
  33. bdo_toolkit/solare/_live_tracker.py +472 -0
  34. bdo_toolkit/solare/_replay_capture.py +182 -0
  35. bdo_toolkit/solare/_result.py +441 -0
  36. bdo_toolkit/solare/_scanner.py +203 -0
  37. bdo_toolkit/solare/_validation.py +11 -0
  38. bdo_toolkit/solare/async_session.py +444 -0
  39. bdo_toolkit/solare/models.py +806 -0
  40. bdo_toolkit/solare/replay.py +62 -0
  41. bdo_toolkit/solare/session.py +1051 -0
  42. bdo_toolkit/writers.py +30 -0
  43. bdo_toolkit-1.0.0.dist-info/METADATA +143 -0
  44. bdo_toolkit-1.0.0.dist-info/RECORD +48 -0
  45. bdo_toolkit-1.0.0.dist-info/WHEEL +5 -0
  46. bdo_toolkit-1.0.0.dist-info/entry_points.txt +2 -0
  47. bdo_toolkit-1.0.0.dist-info/licenses/LICENSE +21 -0
  48. bdo_toolkit-1.0.0.dist-info/top_level.txt +1 -0
bdo_toolkit/writers.py ADDED
@@ -0,0 +1,30 @@
1
+ """Output writers for decoded events."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import sys
7
+ from typing import TextIO
8
+
9
+ from .events import BDOEvent
10
+
11
+
12
+ class ConsoleEventWriter:
13
+ """Write human-readable one-line events."""
14
+
15
+ def __init__(self, stream: TextIO | None = None) -> None:
16
+ self.stream = stream if stream is not None else sys.stdout
17
+
18
+ def write(self, event: BDOEvent) -> None:
19
+ print(event.format_human(), file=self.stream)
20
+
21
+
22
+ class JsonlEventWriter:
23
+ """Write newline-delimited JSON events."""
24
+
25
+ def __init__(self, stream: TextIO | None = None) -> None:
26
+ self.stream = stream if stream is not None else sys.stdout
27
+
28
+ def write(self, event: BDOEvent) -> None:
29
+ print(json.dumps(event.to_dict(), sort_keys=True), file=self.stream)
30
+
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: bdo-toolkit
3
+ Version: 1.0.0
4
+ Summary: Passive, read-only BDO packet parsing toolkit for app developers.
5
+ Author: bdo-toolkit contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/ychwu/bdo-toolkit
8
+ Project-URL: Documentation, https://ychwu.github.io/bdo-toolkit/
9
+ Project-URL: Repository, https://github.com/ychwu/bdo-toolkit.git
10
+ Project-URL: Issues, https://github.com/ychwu/bdo-toolkit/issues
11
+ Keywords: bdo,packets,parse,pcap,passive
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: scapy>=2.5
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest; extra == "dev"
23
+ Requires-Dist: pytest-cov; extra == "dev"
24
+ Requires-Dist: mypy; extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ # bdo-toolkit
28
+
29
+ [![CI](https://img.shields.io/github/actions/workflow/status/ychwu/bdo-toolkit/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/ychwu/bdo-toolkit/actions/workflows/ci.yml)
30
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white)](https://github.com/ychwu/bdo-toolkit/blob/main/pyproject.toml)
31
+ ![Tested on NA/EU](https://img.shields.io/badge/tested-NA%2FEU-5b61a8?style=flat-square)
32
+ [![Package: Stable](https://img.shields.io/badge/package-stable-2f855a?style=flat-square)](https://ychwu.github.io/bdo-toolkit/#stability)
33
+ [![License: MIT](https://img.shields.io/badge/license-MIT-2f855a?style=flat-square)](https://github.com/ychwu/bdo-toolkit/blob/main/LICENSE)
34
+
35
+ Passive, read-only Python tooling that turns live or recorded Black Desert
36
+ traffic into structured, application-ready data.
37
+
38
+ [Documentation](https://ychwu.github.io/bdo-toolkit/) ·
39
+ [Quickstart](https://ychwu.github.io/bdo-toolkit/#quickstart) ·
40
+ [Examples](https://ychwu.github.io/bdo-toolkit/#item-examples) ·
41
+ [API index](https://ychwu.github.io/bdo-toolkit/#api-index) ·
42
+ [Report an issue](https://github.com/ychwu/bdo-toolkit/issues)
43
+
44
+ > **Passive, read-only boundary.** bdo-toolkit observes local traffic or saved
45
+ > captures. It does not send or modify packets, replay traffic to the game,
46
+ > automate gameplay, inspect process memory, or bypass anti-cheat software.
47
+
48
+ ## Capabilities
49
+
50
+ | In-game task | Python result | Status | Guide |
51
+ | --- | --- | --- | --- |
52
+ | Watch supported item changes such as loot, gathering, and storage activity | A continuing stream of typed `BDOEvent` objects | Stable | [Item events](https://ychwu.github.io/bdo-toolkit/#item-overview) |
53
+ | Log in or switch characters | One observational `ItemStateSnapshot` of inventory, known balances, and town storage | Beta | [Inventory & town storage](https://ychwu.github.io/bdo-toolkit/#item-state-overview) |
54
+ | Load the Arena of Solare Leaderboard | One `SolareCaptureResult`; a complete result contains a leaderboard snapshot | Beta | [Arena of Solare](https://ychwu.github.io/bdo-toolkit/#solare-overview) |
55
+
56
+ Testing and validation cover **NA/EU only**. Compatibility with other regional
57
+ services is unknown.
58
+
59
+ ## Installation
60
+
61
+ ```powershell
62
+ python -m pip install bdo-toolkit
63
+ ```
64
+
65
+ Python 3.10 or newer is required. Before live capture, complete
66
+ [Installation & setup](https://ychwu.github.io/bdo-toolkit/#capture-foundation),
67
+ including Npcap on Windows and permission to capture on the selected interface.
68
+ Offline PCAP and PCAPNG replay does not require Npcap.
69
+
70
+ ## Get started
71
+
72
+ 1. Complete [Installation & setup](https://ychwu.github.io/bdo-toolkit/#capture-foundation).
73
+ 2. For item events or item state, prepare a current local profile through
74
+ [Opcode profile setup](https://ychwu.github.io/bdo-toolkit/#profiles).
75
+ 3. Run the [Quickstart](https://ychwu.github.io/bdo-toolkit/#quickstart) or
76
+ choose a task from the [Examples](https://ychwu.github.io/bdo-toolkit/#item-examples)
77
+ index.
78
+
79
+ Local calibration is the dependable patch-day path because maintained profiles
80
+ require manual verification and may lag a weekly update. The
81
+ [Calibration guide](https://ychwu.github.io/bdo-toolkit/#calibration-workflow)
82
+ walks through rebuilding one. Arena of Solare uses structural classification
83
+ and does not require an item opcode profile.
84
+
85
+ ## Runnable examples
86
+
87
+ The source checkout includes maintained, run-ready lessons. They are not
88
+ installed with the Python wheel.
89
+
90
+ | Workflow | Representative script |
91
+ | --- | --- |
92
+ | Observe live item activity | [`examples/live_transfer_log.py`](https://github.com/ychwu/bdo-toolkit/blob/main/examples/live_transfer_log.py) |
93
+ | Capture inventory and town storage on character load | [`examples/live_character_load_snapshot.py`](https://github.com/ychwu/bdo-toolkit/blob/main/examples/live_character_load_snapshot.py) |
94
+ | Rebuild an item profile after a patch | [`examples/live_calibrate_profile.py`](https://github.com/ychwu/bdo-toolkit/blob/main/examples/live_calibrate_profile.py) |
95
+ | Capture an Arena of Solare leaderboard load | [`examples/solare_live_snapshot.py`](https://github.com/ychwu/bdo-toolkit/blob/main/examples/solare_live_snapshot.py) |
96
+
97
+ See the [Examples index](https://ychwu.github.io/bdo-toolkit/#item-examples)
98
+ for every script, its prerequisites, and the guide that explains it.
99
+
100
+ ## Documentation
101
+
102
+ The documentation separates task-focused guides from the symbol-first API
103
+ reference. Exact signatures, fields, lifecycle behavior, and failure contracts
104
+ live there rather than in this README.
105
+
106
+ | Goal | Start here |
107
+ | --- | --- |
108
+ | Understand the package | [Overview](https://ychwu.github.io/bdo-toolkit/#overview) |
109
+ | Build with live item events | [Item events](https://ychwu.github.io/bdo-toolkit/#item-overview) |
110
+ | Query character inventory and town storage | [Inventory & town storage](https://ychwu.github.io/bdo-toolkit/#item-state-overview) |
111
+ | Rebuild item decoding after a patch | [Calibration](https://ychwu.github.io/bdo-toolkit/#calibration-workflow) |
112
+ | Capture and query an Arena of Solare leaderboard | [Arena of Solare](https://ychwu.github.io/bdo-toolkit/#solare-overview) |
113
+ | Integrate with an asyncio application | [Asyncio integration](https://ychwu.github.io/bdo-toolkit/#asyncio) |
114
+ | Look up a class, function, or model | [API index](https://ychwu.github.io/bdo-toolkit/#api-index) |
115
+ | Use the terminal interface | [Command line](https://ychwu.github.io/bdo-toolkit/#cli) |
116
+ | Diagnose a problem | [Troubleshooting](https://ychwu.github.io/bdo-toolkit/#errors) |
117
+ | Review data handling and project boundaries | [Safety & privacy](https://ychwu.github.io/bdo-toolkit/#stability) |
118
+
119
+ ## Support
120
+
121
+ For questions, contact me on Discord: `._.__.__._._.__._____.__._.___.`
122
+
123
+ For bugs and feature requests, [open a GitHub issue](https://github.com/ychwu/bdo-toolkit/issues).
124
+
125
+ ## Development
126
+
127
+ ```powershell
128
+ git clone https://github.com/ychwu/bdo-toolkit.git
129
+ cd bdo-toolkit
130
+ python -m pip install -e ".[dev]"
131
+ python -m pytest -q -W error
132
+ python -m mypy src/bdo_toolkit
133
+ python -m pip wheel . --no-deps --wheel-dir dist
134
+ ```
135
+
136
+ CI runs tests, type checking, wheel construction, and a CLI smoke test on
137
+ Ubuntu and Windows with Python 3.10 and 3.14. Tests that require private
138
+ game-session captures skip when those local fixtures are absent.
139
+
140
+ ## License
141
+
142
+ bdo-toolkit is available under the
143
+ [MIT License](https://github.com/ychwu/bdo-toolkit/blob/main/LICENSE).
@@ -0,0 +1,48 @@
1
+ bdo_toolkit/__init__.py,sha256=IHHF-M0Kej4hJseFCoifUzqNCUMGUpkQgdepExpMeiI,2426
2
+ bdo_toolkit/_async_sessions.py,sha256=Bivq2z6meNg9js7Cfl_tl0DZcIxpWLhxuSFvzzshIac,23526
3
+ bdo_toolkit/_capture_backend.py,sha256=jIDrwcZlDAkbxnDykygKIhWrfXuvrqzyV_T14GpQWqQ,6309
4
+ bdo_toolkit/_capture_options.py,sha256=V4yXghywFI5ryABa4y2f4-J8cwRLpGDkYelhg0Z5orA,2599
5
+ bdo_toolkit/_capture_runtime.py,sha256=7mtmZO1RG_3JeC2W5kmzLr14-9dY7xEEOqljcOjqlKE,23158
6
+ bdo_toolkit/_deposit_origin.py,sha256=pvTP8EbqplwkYa7UEDfWhdh_CljapRBbg1DGitf2Pqc,65498
7
+ bdo_toolkit/_engine.py,sha256=5vA6C9pFV2RQX3Qu-4IoaEtss_p9NLwVUAtt_Q6swq4,11465
8
+ bdo_toolkit/_framing.py,sha256=jW052Z9emzuJgoFQLUzgjPS_KwZqmLA3T_Y0G4N_UlI,35838
9
+ bdo_toolkit/_profile_runtime.py,sha256=SITpl3lYAsJAZTV6yGQxGF93GNtiPDZA3LTz5cOK3Mw,5370
10
+ bdo_toolkit/_protocol.py,sha256=qNlz1i0TwjPDYclt2GoLFLZs2YVbmAh0oBpI4mPISsM,14784
11
+ bdo_toolkit/_reassembly.py,sha256=z-AHz9DE3FCN_9dSUrfyEtSqJCEKUWP7QaPJw-Y7LZ0,24695
12
+ bdo_toolkit/_specs.py,sha256=ivYMusVRoKfL8NKef3kWXLRmgSN2qj_NLaRUnLU8huY,10447
13
+ bdo_toolkit/_storage_destination_validation.py,sha256=ddZsl90PoWcrAskaFztkhDUkmI2Ny2RRp5qncJA_PzA,5972
14
+ bdo_toolkit/_storage_hydration.py,sha256=YcI6XM--Xlr3u2yompwFneHmZGd2zDZdKWDWdLAZw9Y,9193
15
+ bdo_toolkit/_version.py,sha256=HH494g2Nndp-6bbDaaespNyaGP_MwltdAVHldX5e40Q,89
16
+ bdo_toolkit/calibration.py,sha256=BtUV4uAtwGaKzYRTIParnS_Ln-k3oapAZVRqjn4sSOI,119749
17
+ bdo_toolkit/capture.py,sha256=rD88UINPSm1UkCmL4n514XqGl1Rujlciy2d1PUzHK3M,67827
18
+ bdo_toolkit/character_state.py,sha256=mUzSnNeMXUiSnvA24kDHH_G00nzcFUl5Y2_FkKeJ-e0,133342
19
+ bdo_toolkit/cli.py,sha256=YvbGi2wUlAgh_OG_ELJDIPl51SNEKr_Z6H8-v5AhjEA,30161
20
+ bdo_toolkit/diagnostics.py,sha256=9AIeMjRvhHu6WsOzGN27jVGY3HRJaiyVFJexvaiSGcI,1533
21
+ bdo_toolkit/events.py,sha256=TUC34zzyx7x1Yn2m6I7Op7za5v5OAoWt3xBwVTE8sm8,7863
22
+ bdo_toolkit/filters.py,sha256=xIo51ZlzaiGn-zSnASoqwgfEwgogA7TYSkUzRuOJFG0,3520
23
+ bdo_toolkit/item_state.py,sha256=VGGNmDrxnS3Yp9Qsmdl3WD--KHHQwkHQ4uGgHszwLOg,1420
24
+ bdo_toolkit/origin_learning.py,sha256=cok8NdlriW57SdzFEy1jJvrKm75tk__KqGcXQeMXRP4,30513
25
+ bdo_toolkit/profiles.py,sha256=C9o5QnIBGJJ8aUZybl-fesR_4d6FleBAcyaknGpaei8,13535
26
+ bdo_toolkit/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
27
+ bdo_toolkit/remote_profiles.py,sha256=8hp1yy51aRMp1A-xPXciWMBPUhYqmMu9MzPV6LT4F54,12393
28
+ bdo_toolkit/writers.py,sha256=kDSsbjgRaqSbudnff_ZOTZZldseYe-lsRF45Qjogki0,795
29
+ bdo_toolkit/solare/__init__.py,sha256=SYp35eP1KAJJemq3CAM8WbuL41eXU4s0EQtN4NrsLtY,1357
30
+ bdo_toolkit/solare/_constants.py,sha256=mkBFbCEC4qzyxIKjXUHOeZI9T07p9KfguaiE7jc_jsM,2519
31
+ bdo_toolkit/solare/_detail_learning.py,sha256=lRqvCfWocoAuRomTMlAYXb-s-XRZJPnPfPnMmLHJdgE,48167
32
+ bdo_toolkit/solare/_details.py,sha256=60sfUzwckxODQAdSDKqkDPCZP8l3mkDL5_PJY4NBIzg,25307
33
+ bdo_toolkit/solare/_discovery.py,sha256=_MNxRjRj3tM_j8XCpHXAAWgMj_2CT0gqGsgiC93ArKw,41783
34
+ bdo_toolkit/solare/_live_tracker.py,sha256=2B39t0YRMuRIIPazL-by88YxO48yR_ETDbc_4aVSIdc,16882
35
+ bdo_toolkit/solare/_replay_capture.py,sha256=3CdQmNJvITRGCpHMbPvwtJm8NMWXzs3dCsSx2SUdeOk,6496
36
+ bdo_toolkit/solare/_result.py,sha256=5NOlF7meWb9RNOIiwtY7FrH5xSHlc-li8WnGB9nFqCA,14812
37
+ bdo_toolkit/solare/_scanner.py,sha256=ZT8k7YQfh08jwViHlLEYcaQgq01rqjYp611v1WdUeSQ,7362
38
+ bdo_toolkit/solare/_validation.py,sha256=t0VKdqtE5CmMAG0IZmGf0QXnWkCsFpotK_MVm4IX0eg,368
39
+ bdo_toolkit/solare/async_session.py,sha256=Iv46B-HtUCbpkf0ajj4BOxGahXWAcjo9wXHPkrJMP0Q,16171
40
+ bdo_toolkit/solare/models.py,sha256=LeZZap5uMomma75r0uFViqn-3lvtzEnGLYVYBDQQZEo,28430
41
+ bdo_toolkit/solare/replay.py,sha256=2QscwgSKusDOP7UFS9IDS7HjS8IwpM5MiAxaYxk5MZo,2294
42
+ bdo_toolkit/solare/session.py,sha256=oDwHy8p0bEbW5IeKPk-31ki4GmyWNT26Yks2IHwr6Jw,40844
43
+ bdo_toolkit-1.0.0.dist-info/licenses/LICENSE,sha256=l6s0mOHPy4FbEBRHkIutumdsQ9Pnvje39r8kMK5GEqM,1081
44
+ bdo_toolkit-1.0.0.dist-info/METADATA,sha256=jXr_sVqdsWtgNgP9gcZl6t0nn8J6cjry4yZZd-WOpSo,7437
45
+ bdo_toolkit-1.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
46
+ bdo_toolkit-1.0.0.dist-info/entry_points.txt,sha256=ZB5mucU2MHptLvVEwxHA8aatxic87jI-2kqChu2N9Io,53
47
+ bdo_toolkit-1.0.0.dist-info/top_level.txt,sha256=GePLVxjtrl4i5e3gKwUEzqxYW0_6dFI2rydrFykiXdk,12
48
+ bdo_toolkit-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ bdo-toolkit = bdo_toolkit.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bdo-toolkit contributors
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.
@@ -0,0 +1 @@
1
+ bdo_toolkit