Skip to content

Commit 8592e4e

Browse files
AlanFokCoclaude
andcommitted
feat: export A-share specific data functions from eqlib module
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0d29151 commit 8592e4e

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

eqlib/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ def market_open(context):
9494
set_universe, get_universe,
9595
# Lifecycle callbacks [STABLE]
9696
before_trading_start, after_trading_end,
97+
# A-share market specific data [EXPERIMENTAL]
98+
get_north_money_flow,
99+
get_margin_data,
100+
get_limit_up_down_stats,
101+
get_restriction_release,
97102
)
98103

99104
# Logging [STABLE]
@@ -286,6 +291,9 @@ def __repr__(self):
286291
"set_universe", "get_universe",
287292
# P0: Lifecycle callbacks
288293
"before_trading_start", "after_trading_end",
294+
# A-share market specific data
295+
"get_north_money_flow", "get_margin_data",
296+
"get_limit_up_down_stats", "get_restriction_release",
289297
# Logging
290298
"log",
291299
# Objects

tests/test_ashare_data.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,21 @@ def test_days_parameter(self):
143143
df_60 = get_restriction_release(days=60)
144144

145145
# 60 天范围应包含更多解禁事件
146-
assert len(df_60) >= len(df_30)
146+
assert len(df_60) >= len(df_30)
147+
148+
149+
class TestModuleExports:
150+
"""Tests for module exports."""
151+
152+
def test_import_from_eqlib(self):
153+
"""验证可以从 eqlib 导入"""
154+
from eqlib import (
155+
get_north_money_flow,
156+
get_margin_data,
157+
get_limit_up_down_stats,
158+
get_restriction_release,
159+
)
160+
assert get_north_money_flow is not None
161+
assert get_margin_data is not None
162+
assert get_limit_up_down_stats is not None
163+
assert get_restriction_release is not None

0 commit comments

Comments
 (0)