v0.8.7 - Eurobond historical daily prices
New Features
- Eurobond historical prices (closes #11):
Eurobond.history()returns a DataFrame of daily bid/ask prices and yields across a date range. Weekends are skipped (Ziraat API returns zeros), holidays and suspended days are filtered, and per-date results are cached so repeat queries are instant.
import borsapy as bp
bond = bp.Eurobond("US900123DG28")
# Period-based lookback
df = bond.history(period="1y")
# Explicit date range
df = bond.history(start="2021-08-16", end="2026-03-11")
print(df.head())
# bid_price bid_yield ask_price ask_yield days_to_maturity
# Date
# 2024-10-01 118.353000 6.75 120.255083 6.48 3032
# 2024-10-02 118.129042 6.78 119.997125 6.52 3031
# ...Parameters
period: Lookback window ending today. One of1mo,3mo,6mo,1y,2y,3y,5y,10y,ytd,max.start/end: Accepts"YYYY-MM-DD","DD.MM.YYYY",datetime, ordate.skip_weekends:Trueby default.
Performance
Implemented client-side via one HTTP request per business day against the Ziraat Bank API (GetZBBonoTahvilOran), using a ThreadPoolExecutor (5 workers). Expect ~10s per year on a cold cache; subsequent calls hit the per-date cache (TTL.OHLCV_HISTORY, 1 hour).
Technical Changes
borsapy/_providers/ziraat_eurobond.py: newget_history(),_iter_business_dates(),_fetch_bonds_for_date_cached()borsapy/eurobond.py: newEurobond.history()+_parse_date_arghelper (accepts 5 date formats including Turkish dottedDD.MM.YYYY)- 26 new unit tests in
tests/test_eurobond.pycovering date parsing, business-day enumeration, ISIN normalization, zero-price filtering, sort invariance, and period/start resolution