easy-tdx 1.0.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.
Files changed (178) hide show
  1. easy_tdx-1.0.0/.claude/settings.json +16 -0
  2. easy_tdx-1.0.0/.claude/settings.local.json +25 -0
  3. easy_tdx-1.0.0/.claude/skills/verify/SKILL.md +16 -0
  4. easy_tdx-1.0.0/.gitignore +12 -0
  5. easy_tdx-1.0.0/.omc/project-memory.json +161 -0
  6. easy_tdx-1.0.0/.omc/sessions/1c05c4c7-0987-444f-b329-e1c772d1a048.json +8 -0
  7. easy_tdx-1.0.0/.omc/sessions/718ffd08-a67f-463d-ae5b-dea1d6703fc8.json +8 -0
  8. easy_tdx-1.0.0/.omc/sessions/84b721c5-06e3-4191-ae03-5f4795cf33f3.json +8 -0
  9. easy_tdx-1.0.0/.omc/sessions/8e49af4a-ddee-483a-92bb-550dbb3cc506.json +8 -0
  10. easy_tdx-1.0.0/.omc/sessions/a3ab4095-2313-431e-be46-a80ffa727e66.json +8 -0
  11. easy_tdx-1.0.0/.omc/state/checkpoints/checkpoint-2026-05-21T18-43-39-867Z.json +16 -0
  12. easy_tdx-1.0.0/.omc/state/checkpoints/checkpoint-2026-05-21T19-44-09-192Z.json +16 -0
  13. easy_tdx-1.0.0/.omc/state/hud-stdin-cache.json +1 -0
  14. easy_tdx-1.0.0/.omc/state/last-tool-error.json +7 -0
  15. easy_tdx-1.0.0/.omc/state/sessions/1c05c4c7-0987-444f-b329-e1c772d1a048/hud-state.json +6 -0
  16. easy_tdx-1.0.0/.omc/state/sessions/4a6378cc-96bc-4f30-809a-a6b4c4243d5e/session-started.json +6 -0
  17. easy_tdx-1.0.0/.omc/state/sessions/5cd5ba61-645e-434d-8bac-a6d106a4b5fe/hud-state.json +6 -0
  18. easy_tdx-1.0.0/.omc/state/sessions/5cd5ba61-645e-434d-8bac-a6d106a4b5fe/session-started.json +6 -0
  19. easy_tdx-1.0.0/.omc/state/sessions/718ffd08-a67f-463d-ae5b-dea1d6703fc8/hud-state.json +6 -0
  20. easy_tdx-1.0.0/.omc/state/sessions/84b721c5-06e3-4191-ae03-5f4795cf33f3/hud-state.json +6 -0
  21. easy_tdx-1.0.0/.omc/state/sessions/8e49af4a-ddee-483a-92bb-550dbb3cc506/hud-state.json +6 -0
  22. easy_tdx-1.0.0/.omc/state/sessions/a3ab4095-2313-431e-be46-a80ffa727e66/hud-state.json +6 -0
  23. easy_tdx-1.0.0/CLAUDE.md +55 -0
  24. easy_tdx-1.0.0/LICENSE +34 -0
  25. easy_tdx-1.0.0/NOTICE +24 -0
  26. easy_tdx-1.0.0/PKG-INFO +666 -0
  27. easy_tdx-1.0.0/README.md +634 -0
  28. easy_tdx-1.0.0/docs/api_reference.md +623 -0
  29. easy_tdx-1.0.0/docs/field_mapping.md +315 -0
  30. easy_tdx-1.0.0/examples/01_connection/async_connect.py +20 -0
  31. easy_tdx-1.0.0/examples/01_connection/connect_best_host.py +13 -0
  32. easy_tdx-1.0.0/examples/01_connection/ping_servers.py +9 -0
  33. easy_tdx-1.0.0/examples/02_market_info/market_stat.py +7 -0
  34. easy_tdx-1.0.0/examples/02_market_info/security_count.py +9 -0
  35. easy_tdx-1.0.0/examples/02_market_info/security_list.py +63 -0
  36. easy_tdx-1.0.0/examples/02_market_info/security_list_all.py +72 -0
  37. easy_tdx-1.0.0/examples/02_market_info/security_quotes.py +18 -0
  38. easy_tdx-1.0.0/examples/03_kline/index_bars.py +14 -0
  39. easy_tdx-1.0.0/examples/03_kline/security_bars.py +13 -0
  40. easy_tdx-1.0.0/examples/04_minute/history_minute_data.py +9 -0
  41. easy_tdx-1.0.0/examples/04_minute/minute_time_data.py +8 -0
  42. easy_tdx-1.0.0/examples/05_transaction/history_transaction.py +10 -0
  43. easy_tdx-1.0.0/examples/05_transaction/transaction_data.py +9 -0
  44. easy_tdx-1.0.0/examples/06_finance/company_info.py +62 -0
  45. easy_tdx-1.0.0/examples/06_finance/finance_info.py +8 -0
  46. easy_tdx-1.0.0/examples/06_finance/price_limits.py +16 -0
  47. easy_tdx-1.0.0/examples/06_finance/xdxr_info.py +8 -0
  48. easy_tdx-1.0.0/examples/07_block/block_info.py +14 -0
  49. easy_tdx-1.0.0/examples/08_fund_flow/fund_flow.py +23 -0
  50. easy_tdx-1.0.0/examples/08_fund_flow/history_fund_flow.py +8 -0
  51. easy_tdx-1.0.0/examples/09_file_download/downloads/block_fg.dat +0 -0
  52. easy_tdx-1.0.0/examples/09_file_download/downloads/block_gn.dat +0 -0
  53. easy_tdx-1.0.0/examples/09_file_download/downloads/block_zs.dat +0 -0
  54. easy_tdx-1.0.0/examples/09_file_download/downloads/gpcw20260331/gpcw20260331.dat +0 -0
  55. easy_tdx-1.0.0/examples/09_file_download/downloads/gpcw20260331.zip +0 -0
  56. easy_tdx-1.0.0/examples/09_file_download/downloads/tdxhy.cfg +5613 -0
  57. easy_tdx-1.0.0/examples/09_file_download/report_file.py +97 -0
  58. easy_tdx-1.0.0/examples/10_offline/block_data.py +87 -0
  59. easy_tdx-1.0.0/examples/10_offline/daily_bars.py +43 -0
  60. easy_tdx-1.0.0/examples/10_offline/detect_home.py +80 -0
  61. easy_tdx-1.0.0/examples/10_offline/ex_daily_bars.py +69 -0
  62. easy_tdx-1.0.0/examples/10_offline/gbbq.py +53 -0
  63. easy_tdx-1.0.0/examples/10_offline/history_financial.py +68 -0
  64. easy_tdx-1.0.0/examples/10_offline/min_bars.py +83 -0
  65. easy_tdx-1.0.0/pyproject.toml +52 -0
  66. easy_tdx-1.0.0/scripts/__init__.py +0 -0
  67. easy_tdx-1.0.0/scripts/probe_unknowns.py +107 -0
  68. easy_tdx-1.0.0/scripts/ruff_hook.py +43 -0
  69. easy_tdx-1.0.0/scripts/verify_fixes_20260415.py +128 -0
  70. easy_tdx-1.0.0/src/easy_tdx/__init__.py +78 -0
  71. easy_tdx-1.0.0/src/easy_tdx/_binary.py +48 -0
  72. easy_tdx-1.0.0/src/easy_tdx/_df.py +111 -0
  73. easy_tdx-1.0.0/src/easy_tdx/client.py +1185 -0
  74. easy_tdx-1.0.0/src/easy_tdx/codec/__init__.py +18 -0
  75. easy_tdx-1.0.0/src/easy_tdx/codec/block.py +69 -0
  76. easy_tdx-1.0.0/src/easy_tdx/codec/datetime_.py +69 -0
  77. easy_tdx-1.0.0/src/easy_tdx/codec/financial.py +101 -0
  78. easy_tdx-1.0.0/src/easy_tdx/codec/frame.py +63 -0
  79. easy_tdx-1.0.0/src/easy_tdx/codec/industry.py +23 -0
  80. easy_tdx-1.0.0/src/easy_tdx/codec/price.py +64 -0
  81. easy_tdx-1.0.0/src/easy_tdx/codec/price_rules.py +94 -0
  82. easy_tdx-1.0.0/src/easy_tdx/codec/volume.py +57 -0
  83. easy_tdx-1.0.0/src/easy_tdx/commands/__init__.py +10 -0
  84. easy_tdx-1.0.0/src/easy_tdx/commands/base.py +29 -0
  85. easy_tdx-1.0.0/src/easy_tdx/commands/block_info.py +61 -0
  86. easy_tdx-1.0.0/src/easy_tdx/commands/company_info.py +78 -0
  87. easy_tdx-1.0.0/src/easy_tdx/commands/finance_info.py +90 -0
  88. easy_tdx-1.0.0/src/easy_tdx/commands/fund_flow.py +75 -0
  89. easy_tdx-1.0.0/src/easy_tdx/commands/minute_time.py +70 -0
  90. easy_tdx-1.0.0/src/easy_tdx/commands/report_file.py +32 -0
  91. easy_tdx-1.0.0/src/easy_tdx/commands/security_bars.py +157 -0
  92. easy_tdx-1.0.0/src/easy_tdx/commands/security_count.py +25 -0
  93. easy_tdx-1.0.0/src/easy_tdx/commands/security_list.py +68 -0
  94. easy_tdx-1.0.0/src/easy_tdx/commands/security_quotes.py +203 -0
  95. easy_tdx-1.0.0/src/easy_tdx/commands/setup.py +18 -0
  96. easy_tdx-1.0.0/src/easy_tdx/commands/transaction.py +105 -0
  97. easy_tdx-1.0.0/src/easy_tdx/commands/xdxr_info.py +107 -0
  98. easy_tdx-1.0.0/src/easy_tdx/ex/__init__.py +11 -0
  99. easy_tdx-1.0.0/src/easy_tdx/ex/client.py +439 -0
  100. easy_tdx-1.0.0/src/easy_tdx/ex/commands/__init__.py +1 -0
  101. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_history_bars_range.py +76 -0
  102. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_instrument_bars.py +74 -0
  103. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_instrument_count.py +17 -0
  104. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_instrument_info.py +50 -0
  105. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_instrument_quote.py +103 -0
  106. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_instrument_quote_list.py +218 -0
  107. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_markets.py +41 -0
  108. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_minute_time.py +74 -0
  109. easy_tdx-1.0.0/src/easy_tdx/ex/commands/get_transaction.py +97 -0
  110. easy_tdx-1.0.0/src/easy_tdx/ex/commands/setup.py +16 -0
  111. easy_tdx-1.0.0/src/easy_tdx/ex/models.py +158 -0
  112. easy_tdx-1.0.0/src/easy_tdx/ex/transport/__init__.py +1 -0
  113. easy_tdx-1.0.0/src/easy_tdx/ex/transport/async_.py +125 -0
  114. easy_tdx-1.0.0/src/easy_tdx/ex/transport/sync.py +163 -0
  115. easy_tdx-1.0.0/src/easy_tdx/exceptions.py +25 -0
  116. easy_tdx-1.0.0/src/easy_tdx/models/__init__.py +29 -0
  117. easy_tdx-1.0.0/src/easy_tdx/models/bar.py +28 -0
  118. easy_tdx-1.0.0/src/easy_tdx/models/enums.py +24 -0
  119. easy_tdx-1.0.0/src/easy_tdx/models/finance.py +157 -0
  120. easy_tdx-1.0.0/src/easy_tdx/models/quote.py +80 -0
  121. easy_tdx-1.0.0/src/easy_tdx/models/security.py +23 -0
  122. easy_tdx-1.0.0/src/easy_tdx/models/stats.py +69 -0
  123. easy_tdx-1.0.0/src/easy_tdx/models/timeseries.py +39 -0
  124. easy_tdx-1.0.0/src/easy_tdx/offline/__init__.py +37 -0
  125. easy_tdx-1.0.0/src/easy_tdx/offline/block.py +92 -0
  126. easy_tdx-1.0.0/src/easy_tdx/offline/daily_bar.py +131 -0
  127. easy_tdx-1.0.0/src/easy_tdx/offline/ex_daily_bar.py +82 -0
  128. easy_tdx-1.0.0/src/easy_tdx/offline/finders.py +38 -0
  129. easy_tdx-1.0.0/src/easy_tdx/offline/gbbq.py +366 -0
  130. easy_tdx-1.0.0/src/easy_tdx/offline/history_financial.py +59 -0
  131. easy_tdx-1.0.0/src/easy_tdx/offline/min_bar.py +122 -0
  132. easy_tdx-1.0.0/src/easy_tdx/offline/paths.py +74 -0
  133. easy_tdx-1.0.0/src/easy_tdx/py.typed +1 -0
  134. easy_tdx-1.0.0/src/easy_tdx/transport/__init__.py +4 -0
  135. easy_tdx-1.0.0/src/easy_tdx/transport/async_.py +149 -0
  136. easy_tdx-1.0.0/src/easy_tdx/transport/sync.py +250 -0
  137. easy_tdx-1.0.0/tests/__init__.py +0 -0
  138. easy_tdx-1.0.0/tests/fixtures/company_info_category.hex +1 -0
  139. easy_tdx-1.0.0/tests/fixtures/company_info_category.json +8 -0
  140. easy_tdx-1.0.0/tests/fixtures/company_info_content.hex +1 -0
  141. easy_tdx-1.0.0/tests/fixtures/company_info_content.json +4 -0
  142. easy_tdx-1.0.0/tests/fixtures/finance_info.hex +1 -0
  143. easy_tdx-1.0.0/tests/fixtures/finance_info.json +5 -0
  144. easy_tdx-1.0.0/tests/fixtures/history_minute_time.hex +1 -0
  145. easy_tdx-1.0.0/tests/fixtures/history_minute_time.json +7 -0
  146. easy_tdx-1.0.0/tests/fixtures/history_transaction.hex +1 -0
  147. easy_tdx-1.0.0/tests/fixtures/history_transaction.json +9 -0
  148. easy_tdx-1.0.0/tests/fixtures/minute_time.hex +1 -0
  149. easy_tdx-1.0.0/tests/fixtures/minute_time.json +8 -0
  150. easy_tdx-1.0.0/tests/fixtures/security_bars.hex +1 -0
  151. easy_tdx-1.0.0/tests/fixtures/security_bars.json +10 -0
  152. easy_tdx-1.0.0/tests/fixtures/security_count.hex +1 -0
  153. easy_tdx-1.0.0/tests/fixtures/security_count.json +3 -0
  154. easy_tdx-1.0.0/tests/fixtures/security_list.hex +1 -0
  155. easy_tdx-1.0.0/tests/fixtures/security_list.json +8 -0
  156. easy_tdx-1.0.0/tests/fixtures/security_quotes.hex +1 -0
  157. easy_tdx-1.0.0/tests/fixtures/security_quotes.json +9 -0
  158. easy_tdx-1.0.0/tests/fixtures/transaction.hex +1 -0
  159. easy_tdx-1.0.0/tests/fixtures/transaction.json +9 -0
  160. easy_tdx-1.0.0/tests/fixtures/xdxr_info.hex +1 -0
  161. easy_tdx-1.0.0/tests/fixtures/xdxr_info.json +9 -0
  162. easy_tdx-1.0.0/tests/integration/__init__.py +0 -0
  163. easy_tdx-1.0.0/tests/integration/test_live_client.py +36 -0
  164. easy_tdx-1.0.0/tests/unit/__init__.py +0 -0
  165. easy_tdx-1.0.0/tests/unit/test_a_share_extensions.py +301 -0
  166. easy_tdx-1.0.0/tests/unit/test_async_transport.py +139 -0
  167. easy_tdx-1.0.0/tests/unit/test_block_info.py +109 -0
  168. easy_tdx-1.0.0/tests/unit/test_codec_datetime.py +64 -0
  169. easy_tdx-1.0.0/tests/unit/test_codec_frame.py +39 -0
  170. easy_tdx-1.0.0/tests/unit/test_codec_price.py +62 -0
  171. easy_tdx-1.0.0/tests/unit/test_codec_volume.py +36 -0
  172. easy_tdx-1.0.0/tests/unit/test_commands_offline.py +399 -0
  173. easy_tdx-1.0.0/tests/unit/test_decode_errors.py +51 -0
  174. easy_tdx-1.0.0/tests/unit/test_financial_data.py +118 -0
  175. easy_tdx-1.0.0/tests/unit/test_heartbeat.py +69 -0
  176. easy_tdx-1.0.0/tests/unit/test_protocol_fixes.py +163 -0
  177. easy_tdx-1.0.0/tests/unit/test_sync_transport.py +44 -0
  178. easy_tdx-1.0.0/uv.lock +872 -0
@@ -0,0 +1,16 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Write|Edit",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "python scripts/ruff_hook.py",
10
+ "timeout": 30
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Skill(update-config)",
5
+ "Bash(echo '{\"tool_name\":\"Edit\",\"tool_input\":{\"file_path\":\"D:\\\\\\\\python\\\\\\\\xmtdx\\\\\\\\src\\\\\\\\xmtdx\\\\\\\\__init__.py\"}}')",
6
+ "Bash(python -c \"import sys,json,subprocess;d=json.load\\(sys.stdin\\);f=d.get\\('tool_input',{}\\).get\\('file_path',''\\);exec\\('' if not f.endswith\\(\\\\\\\\'.py\\\\\\\\'\\) else 'subprocess.run\\([\\\\\\\\'ruff\\\\\\\\',\\\\\\\\'check\\\\\\\\',\\\\\\\\'--fix\\\\\\\\',f],capture_output=True\\);subprocess.run\\([\\\\\\\\'ruff\\\\\\\\',\\\\\\\\'format\\\\\\\\',f],capture_output=True\\)'\\);print\\(f'done: {f}'\\)\")",
7
+ "Bash(python *)",
8
+ "Bash(ruff check *)",
9
+ "Bash(git add *)",
10
+ "Bash(git commit *)",
11
+ "Bash(git push *)",
12
+ "mcp__zread__get_repo_structure",
13
+ "Bash(pip install *)",
14
+ "mcp__web-reader__webReader",
15
+ "Bash(python3 *)",
16
+ "Bash(where mypy *)",
17
+ "Bash(pip list *)",
18
+ "Bash(uv run *)",
19
+ "Bash(git stash *)",
20
+ "Bash(dir /s /b src\\\\xmtdx)",
21
+ "Bash(git remote *)",
22
+ "Bash(Select-Object -Last 5)"
23
+ ]
24
+ }
25
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: verify
3
+ description: Run full offline verification suite (pytest unit tests + mypy + ruff) before committing changes.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Verify
8
+
9
+ Run the full offline verification pipeline:
10
+
11
+ 1. Run `python -m pytest tests/unit/ -v` — all unit tests must pass.
12
+ 2. Run `mypy src/` — strict type checking must pass with zero errors.
13
+ 3. Run `ruff check src/ tests/` — no lint errors.
14
+ 4. Run `ruff format --check src/ tests/` — formatting must be clean.
15
+
16
+ If any step fails, fix the issues and re-run. Do not report completion until all four steps pass.
@@ -0,0 +1,12 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .eggs/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+ .pytest_cache/
10
+ *.egg
11
+ .venv/
12
+ venv/
@@ -0,0 +1,161 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "lastScanned": 1779424107452,
4
+ "projectRoot": "D:\\python\\easty_tdx",
5
+ "techStack": {
6
+ "languages": [
7
+ {
8
+ "name": "Python",
9
+ "version": null,
10
+ "confidence": "high",
11
+ "markers": [
12
+ "pyproject.toml"
13
+ ]
14
+ }
15
+ ],
16
+ "frameworks": [
17
+ {
18
+ "name": "pytest",
19
+ "version": null,
20
+ "category": "testing"
21
+ }
22
+ ],
23
+ "packageManager": null,
24
+ "runtime": null
25
+ },
26
+ "build": {
27
+ "buildCommand": null,
28
+ "testCommand": "pytest",
29
+ "lintCommand": "ruff check",
30
+ "devCommand": null,
31
+ "scripts": {}
32
+ },
33
+ "conventions": {
34
+ "namingStyle": null,
35
+ "importStyle": null,
36
+ "testPattern": null,
37
+ "fileOrganization": null
38
+ },
39
+ "structure": {
40
+ "isMonorepo": false,
41
+ "workspaces": [],
42
+ "mainDirectories": [
43
+ "docs",
44
+ "examples",
45
+ "scripts",
46
+ "src",
47
+ "tests"
48
+ ],
49
+ "gitBranches": {
50
+ "defaultBranch": "main",
51
+ "branchingStrategy": null
52
+ }
53
+ },
54
+ "customNotes": [],
55
+ "directoryMap": {
56
+ "docs": {
57
+ "path": "docs",
58
+ "purpose": "Documentation",
59
+ "fileCount": 2,
60
+ "lastAccessed": 1779424107425,
61
+ "keyFiles": [
62
+ "api_reference.md",
63
+ "field_mapping.md"
64
+ ]
65
+ },
66
+ "examples": {
67
+ "path": "examples",
68
+ "purpose": "Example code",
69
+ "fileCount": 0,
70
+ "lastAccessed": 1779424107425,
71
+ "keyFiles": []
72
+ },
73
+ "scripts": {
74
+ "path": "scripts",
75
+ "purpose": "Build/utility scripts",
76
+ "fileCount": 4,
77
+ "lastAccessed": 1779424107426,
78
+ "keyFiles": [
79
+ "probe_unknowns.py",
80
+ "ruff_hook.py",
81
+ "verify_fixes_20260415.py",
82
+ "__init__.py"
83
+ ]
84
+ },
85
+ "src": {
86
+ "path": "src",
87
+ "purpose": "Source code",
88
+ "fileCount": 0,
89
+ "lastAccessed": 1779424107427,
90
+ "keyFiles": []
91
+ },
92
+ "tests": {
93
+ "path": "tests",
94
+ "purpose": "Test files",
95
+ "fileCount": 1,
96
+ "lastAccessed": 1779424107427,
97
+ "keyFiles": [
98
+ "__init__.py"
99
+ ]
100
+ },
101
+ "venv": {
102
+ "path": "venv",
103
+ "purpose": null,
104
+ "fileCount": 2,
105
+ "lastAccessed": 1779424107428,
106
+ "keyFiles": [
107
+ "pyvenv.cfg"
108
+ ]
109
+ },
110
+ "tests\\fixtures": {
111
+ "path": "tests\\fixtures",
112
+ "purpose": "Test fixtures",
113
+ "fileCount": 24,
114
+ "lastAccessed": 1779424107429,
115
+ "keyFiles": [
116
+ "company_info_category.hex",
117
+ "company_info_category.json",
118
+ "company_info_content.hex"
119
+ ]
120
+ },
121
+ "venv\\Lib": {
122
+ "path": "venv\\Lib",
123
+ "purpose": "Library code",
124
+ "fileCount": 0,
125
+ "lastAccessed": 1779424107430,
126
+ "keyFiles": []
127
+ },
128
+ "venv\\Scripts": {
129
+ "path": "venv\\Scripts",
130
+ "purpose": "Build/utility scripts",
131
+ "fileCount": 10,
132
+ "lastAccessed": 1779424107430,
133
+ "keyFiles": [
134
+ "activate",
135
+ "activate.bat",
136
+ "activate.fish"
137
+ ]
138
+ }
139
+ },
140
+ "hotPaths": [
141
+ {
142
+ "path": "pyproject.toml",
143
+ "accessCount": 2,
144
+ "lastAccessed": 1779424332759,
145
+ "type": "file"
146
+ },
147
+ {
148
+ "path": "LICENSE",
149
+ "accessCount": 1,
150
+ "lastAccessed": 1779424203577,
151
+ "type": "file"
152
+ },
153
+ {
154
+ "path": "README.md",
155
+ "accessCount": 1,
156
+ "lastAccessed": 1779424203662,
157
+ "type": "file"
158
+ }
159
+ ],
160
+ "userDirectives": []
161
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "session_id": "1c05c4c7-0987-444f-b329-e1c772d1a048",
3
+ "ended_at": "2026-05-21T17:01:21.757Z",
4
+ "reason": "prompt_input_exit",
5
+ "agents_spawned": 0,
6
+ "agents_completed": 0,
7
+ "modes_used": []
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "session_id": "718ffd08-a67f-463d-ae5b-dea1d6703fc8",
3
+ "ended_at": "2026-05-21T04:31:14.583Z",
4
+ "reason": "clear",
5
+ "agents_spawned": 0,
6
+ "agents_completed": 0,
7
+ "modes_used": []
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "session_id": "84b721c5-06e3-4191-ae03-5f4795cf33f3",
3
+ "ended_at": "2026-05-22T03:33:15.228Z",
4
+ "reason": "prompt_input_exit",
5
+ "agents_spawned": 0,
6
+ "agents_completed": 0,
7
+ "modes_used": []
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "session_id": "8e49af4a-ddee-483a-92bb-550dbb3cc506",
3
+ "ended_at": "2026-05-21T04:31:59.748Z",
4
+ "reason": "prompt_input_exit",
5
+ "agents_spawned": 0,
6
+ "agents_completed": 0,
7
+ "modes_used": []
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "session_id": "a3ab4095-2313-431e-be46-a80ffa727e66",
3
+ "ended_at": "2026-05-21T17:15:43.971Z",
4
+ "reason": "prompt_input_exit",
5
+ "agents_spawned": 0,
6
+ "agents_completed": 0,
7
+ "modes_used": []
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "created_at": "2026-05-21T18:43:39.866Z",
3
+ "trigger": "manual",
4
+ "active_modes": {},
5
+ "todo_summary": {
6
+ "pending": 0,
7
+ "in_progress": 0,
8
+ "completed": 0
9
+ },
10
+ "wisdom_exported": false,
11
+ "background_jobs": {
12
+ "active": [],
13
+ "recent": [],
14
+ "stats": null
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "created_at": "2026-05-21T19:44:09.191Z",
3
+ "trigger": "manual",
4
+ "active_modes": {},
5
+ "todo_summary": {
6
+ "pending": 0,
7
+ "in_progress": 0,
8
+ "completed": 0
9
+ },
10
+ "wisdom_exported": false,
11
+ "background_jobs": {
12
+ "active": [],
13
+ "recent": [],
14
+ "stats": null
15
+ }
16
+ }
@@ -0,0 +1 @@
1
+ {"session_id":"5cd5ba61-645e-434d-8bac-a6d106a4b5fe","transcript_path":"C:\\Users\\毛利哥\\.claude\\projects\\D--python-easty-tdx\\5cd5ba61-645e-434d-8bac-a6d106a4b5fe.jsonl","cwd":"D:\\python\\easty_tdx","effort":{"level":"medium"},"model":{"id":"glm-5.1","display_name":"glm-5.1"},"workspace":{"current_dir":"D:\\python\\easty_tdx","project_dir":"D:\\python\\easty_tdx","added_dirs":[],"repo":{"host":"github.com","owner":"handsomejustin","name":"easy_tdx"}},"version":"2.1.145","output_style":{"name":"default"},"cost":{"total_cost_usd":0.36701300000000003,"total_duration_ms":283709,"total_api_duration_ms":88737,"total_lines_added":24,"total_lines_removed":0},"context_window":{"total_input_tokens":30175,"total_output_tokens":22,"context_window_size":200000,"current_usage":{"input_tokens":223,"output_tokens":22,"cache_creation_input_tokens":0,"cache_read_input_tokens":29952},"used_percentage":15,"remaining_percentage":85},"exceeds_200k_tokens":false,"fast_mode":false,"thinking":{"enabled":true}}
@@ -0,0 +1,7 @@
1
+ {
2
+ "tool_name": "Bash",
3
+ "tool_input_preview": "{\"command\":\"pip install build twine 2>&1 | Select-Object -Last 5\",\"description\":\"Install build and twine\"}",
4
+ "error": "Exit code 127\n/usr/bin/bash: line 1: Select-Object: command not found",
5
+ "timestamp": "2026-05-22T04:32:32.312Z",
6
+ "retry_count": 1
7
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "timestamp": "2026-05-21T04:37:36.738Z",
3
+ "backgroundTasks": [],
4
+ "sessionStartTimestamp": "2026-05-21T04:35:51.188Z",
5
+ "sessionId": "1c05c4c7-0987-444f-b329-e1c772d1a048"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "session_id": "4a6378cc-96bc-4f30-809a-a6b4c4243d5e",
3
+ "started_at": "2026-05-21T17:02:00.621Z",
4
+ "cwd": "D:\\python\\easty_tdx",
5
+ "pid": 13160
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "timestamp": "2026-05-22T04:28:50.834Z",
3
+ "backgroundTasks": [],
4
+ "sessionStartTimestamp": "2026-05-22T04:28:27.433Z",
5
+ "sessionId": "5cd5ba61-645e-434d-8bac-a6d106a4b5fe"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "session_id": "5cd5ba61-645e-434d-8bac-a6d106a4b5fe",
3
+ "started_at": "2026-05-22T04:28:27.408Z",
4
+ "cwd": "D:\\python\\easty_tdx",
5
+ "pid": 36228
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "timestamp": "2026-05-21T04:21:33.768Z",
3
+ "backgroundTasks": [],
4
+ "sessionStartTimestamp": "2026-05-21T04:21:11.890Z",
5
+ "sessionId": "718ffd08-a67f-463d-ae5b-dea1d6703fc8"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "timestamp": "2026-05-21T17:33:21.608Z",
3
+ "backgroundTasks": [],
4
+ "sessionStartTimestamp": "2026-05-21T17:30:31.097Z",
5
+ "sessionId": "84b721c5-06e3-4191-ae03-5f4795cf33f3"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "timestamp": "2026-05-21T04:31:15.192Z",
3
+ "backgroundTasks": [],
4
+ "sessionStartTimestamp": "2026-05-21T04:31:14.919Z",
5
+ "sessionId": "8e49af4a-ddee-483a-92bb-550dbb3cc506"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "timestamp": "2026-05-21T17:07:49.338Z",
3
+ "backgroundTasks": [],
4
+ "sessionStartTimestamp": "2026-05-21T17:07:32.750Z",
5
+ "sessionId": "a3ab4095-2313-431e-be46-a80ffa727e66"
6
+ }
@@ -0,0 +1,55 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Build / Test / Lint
6
+
7
+ ```bash
8
+ # 单元测试(无需网络,使用 tests/fixtures/ 中的 hex 数据)
9
+ python -m pytest tests/unit/ -v
10
+
11
+ # 集成测试(需要网络,默认跳过)
12
+ XMTDX_LIVE=1 python -m pytest tests/integration/ -v
13
+
14
+ # 类型检查(strict mypy)
15
+ mypy src/
16
+
17
+ # lint + format
18
+ ruff check src/ tests/
19
+ ruff format --check src/ tests/
20
+ ```
21
+
22
+ ## 架构
23
+
24
+ ```
25
+ src/easy_tdx/
26
+ ├── client.py # TdxClient / AsyncTdxClient(高层 API)
27
+ ├── transport/
28
+ │ ├── sync.py # TdxConnection(socket)+ ping_host / ping_all
29
+ │ └── async_.py # AsyncTdxConnection(asyncio)
30
+ ├── commands/ # 每条命令:build_request() + parse_response(),无 IO
31
+ ├── codec/ # price / volume / datetime / frame 编解码
32
+ └── models/ # 纯 dataclass,无业务逻辑
33
+ ```
34
+
35
+ commands 层不依赖 transport,可独立单测。修改 codec 或 commands 时不需要网络。
36
+
37
+ ## 协议编解码注意事项
38
+
39
+ - **价格编码**:变长有符号整数(类 LEB128),bit8=继续,bit7=符号。差分编码(相邻 tick 存 delta)。
40
+ - **成交量编码**:4 字节自定义浮点(`_decode_volume`),字节 3=指数,字节 0-2=精度。**不可用于价格字段**。
41
+ - **握手**:连接后必须顺序发送 3 条 setup 命令,响应丢弃。
42
+ - **帧格式**:16 字节响应头,body 按需 zlib 解压。
43
+ - 新增编解码逻辑时务必在 `tests/fixtures/` 中补充 hex fixture 并编写对应的离线解析测试。
44
+
45
+ ## 已知限制
46
+
47
+ - `Market.BJ` 的 `get_security_list()` 不能稳定获取(服务器端问题),不要尝试依赖它。
48
+ - `limit_up` / `limit_down` 在 `SecurityQuote` 中默认为 `None`,涨跌停价应通过 `get_price_limits()` 或 `compute_price_limits()` 计算。
49
+
50
+ ## 代码风格
51
+
52
+ - ruff: line-length 100, target py310, rules: E/F/I/UP
53
+ - mypy strict mode
54
+ - 所有 `get_*` 公开方法返回 `pd.DataFrame`(通过 `_df._to_df()` 转换)。内部方法仍使用 dataclass 列表。
55
+ - 依赖:pandas(>=2.0)、tzdata(>=2024.1)。
easy_tdx-1.0.0/LICENSE ADDED
@@ -0,0 +1,34 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-present easy-tdx 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.
22
+
23
+ ---
24
+
25
+ This project contains code inspired by or derived from the following projects,
26
+ each originally released under the MIT License:
27
+
28
+ 1. pytdx — https://github.com/rainx/pytdx
29
+ Copyright (c) rainx and contributors
30
+ Licensed under the MIT License.
31
+
32
+ 2. xmtdx — https://github.com/minionszyw/xmtdx
33
+ Copyright (c) minionszyw and contributors
34
+ Licensed under the MIT License.
easy_tdx-1.0.0/NOTICE ADDED
@@ -0,0 +1,24 @@
1
+ easy-tdx
2
+ ========
3
+
4
+ This project is an independent implementation of the TongDaXin (TDX)
5
+ TCP protocol client for Chinese A-share market data.
6
+
7
+ Attribution
8
+ -----------
9
+
10
+ This project was inspired by and incorporates ideas from:
11
+
12
+ - pytdx (https://github.com/rainx/pytdx)
13
+ The offline data reading module (daily bars, minute bars, block data,
14
+ gbbq share structure changes, historical financial data) borrows file
15
+ format parsing methods from pytdx. The gbbq XOR decryption key is
16
+ directly ported from pytdx.
17
+
18
+ - xmtdx (https://github.com/minionszyw/xmtdx)
19
+ The initial project structure and online protocol implementation were
20
+ based on xmtdx, which has since been substantially rewritten with bug
21
+ fixes, new features, and a different architecture.
22
+
23
+ Both upstream projects are licensed under the MIT License.
24
+ Their original copyright notices are preserved in the LICENSE file.