48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
import sys
|
|
import os
|
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
|
|
|
|
import lib.custom_logger as get_logger
|
|
logger = get_logger.get_logger(level=10)
|
|
|
|
from dotenv import load_dotenv
|
|
load_dotenv()
|
|
|
|
from providers.tools.api_j_quants import ApiJQuants
|
|
|
|
|
|
def example():
|
|
# 上場企業情報の取得
|
|
client = ApiJQuants()
|
|
|
|
# 銘柄一覧から検索する
|
|
# result = client.search_companies("トヨタ")
|
|
# logger.info(f"Found {len(result)} companies")
|
|
# dic = result.to_dict(orient="records")
|
|
# logger.info(f"First company: {dic if len(dic) > 0 else 'N/A'}")
|
|
|
|
# 銘柄の日足情報を取得する
|
|
# df = client.get_price_daily_quotes(
|
|
# code="7203",
|
|
# start_date="2025-05-01",
|
|
# end_date="2025-05-31",
|
|
# save_csv="./data/fin/silver/y=2025/m=05/7203_price_daily_quotes_2025-06.csv",
|
|
# )
|
|
# logger.info(f"Got {len(df)} rows of daily price data")
|
|
|
|
# # 直近の財務諸表情報を取得する
|
|
# df = client.get_price_daily_quotes(
|
|
# code="7203",
|
|
# save_csv="./data/fin/silver/y=2025/m=09/7203_fins_statements_2025-09-16.csv",
|
|
# )
|
|
# logger.info(f"Got {len(df)} rows of daily price data")
|
|
|
|
# 直近の財務諸表予定を確認する
|
|
df = client.get_fins_announcement(
|
|
save_csv="./data/fin/silver/y=2025/m=09/fins_announcement_2025-09-16.csv",
|
|
)
|
|
|
|
|
|
|
|
|
|
example() |