Initial commit
This commit is contained in:
25
tools/sync_ashare_flows.py
Normal file
25
tools/sync_ashare_flows.py
Normal file
@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "backend"))
|
||||
|
||||
from app.services.ashare_flow_service import ashare_flow_service # noqa: E402
|
||||
|
||||
|
||||
def main() -> None:
|
||||
result = {
|
||||
"index_realtime": ashare_flow_service.sync_index_realtime(),
|
||||
"sector_realtime": ashare_flow_service.sync_sector_realtime(),
|
||||
"index_history": ashare_flow_service.backfill_index_daily_history(),
|
||||
"sector_history": ashare_flow_service.backfill_sector_daily_history(),
|
||||
}
|
||||
print(json.dumps(result, ensure_ascii=False, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user