36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""Test script to verify the improved sector metadata fetching"""
|
||
|
|
|
||
|
|
import sys
|
||
|
|
sys.path.insert(0, '/Users/melchiorreimers/.gemini/antigravity/scratch/trading_daemon/src')
|
||
|
|
|
||
|
|
from metadata.fetcher import fetch_ticker_from_openfigi, fetch_sector_from_yfinance, fetch_metadata
|
||
|
|
|
||
|
|
# Test ISINs from different regions and sectors
|
||
|
|
test_isins = [
|
||
|
|
'US69553P1003', # PagerDuty (US, Technology)
|
||
|
|
'DE000LS1LUS9', # German security
|
||
|
|
'US0378331005', # Apple (US, Technology)
|
||
|
|
]
|
||
|
|
|
||
|
|
print("Testing improved sector metadata fetching...\n")
|
||
|
|
|
||
|
|
for isin in test_isins:
|
||
|
|
print(f"Testing ISIN: {isin}")
|
||
|
|
|
||
|
|
# Test ticker lookup
|
||
|
|
ticker = fetch_ticker_from_openfigi(isin)
|
||
|
|
print(f" Ticker: {ticker}")
|
||
|
|
|
||
|
|
# Test sector lookup if ticker found
|
||
|
|
if ticker:
|
||
|
|
sector = fetch_sector_from_yfinance(ticker)
|
||
|
|
print(f" Sector: {sector}")
|
||
|
|
|
||
|
|
print()
|
||
|
|
|
||
|
|
print("\nFull metadata test for US69553P1003:")
|
||
|
|
metadata = fetch_metadata('US69553P1003')
|
||
|
|
for key, value in metadata.items():
|
||
|
|
print(f" {key}: {value}")
|