Vai al contenuto

πŸ”Œ Asset Providers (Developer)

This section provides the technical deep-dive for each asset pricing provider in LibreFolio. For the end-user perspective, see the User Manual β€” Providers.

πŸ“¦ Providers at a Glance

Provider Code Features get_asset_url params_schema Identifier Types Test Level
Yahoo Finance yfinance History, Search, Metadata βœ… β€” TICKER, ISIN Beta
JustETF justetf History, Search, Metadata βœ… β€” ISIN Beta
CSS Scraper cssscraper Current Value βœ… βœ… URL Beta
Scheduled Investment scheduled_investment History (Calc), Events β€” βœ… AUTO_GENERATED Beta
Mock Provider mockprov History, Search β€” β€” TICKER, ISIN Alpha

πŸ”‘ Feature Key

  • πŸ“ˆ History: Can fetch historical OHLC data.
  • πŸ”Ž Search: Supports searching for assets by name/ticker. Detected via test_search_query is not None.
  • πŸ“‹ Metadata: Can fetch asset details (sector, description, identifiers) via fetch_asset_metadata().
  • πŸ’° Current Value: Can fetch the latest real-time price.
  • πŸ“Š Events: Can produce asset events (dividends, interest, settlements) via supports_events = True.
  • πŸ”— get_asset_url: Generates a link to the provider's page for this asset (e.g., Yahoo Finance quote page).
  • 🧩 params_schema: Exposes a form schema for the frontend to render dynamic configuration fields.
  • πŸ§ͺ Probe: All providers support POST /assets/provider/probe for dry-run testing (current_price, history, metadata operations).

πŸ“ Notes

  • CSS Scraper get_asset_url returns the identifier itself (which is the URL to scrape).
  • Scheduled Investment uses AUTO_GENERATED identifier type β€” no external identifier needed.
  • Mock Provider (mockprov) is only registered when LIBREFOLIO_TEST_MODE is enabled.

πŸ“ˆ Yahoo Finance (yfinance)

The primary market data provider β€” fetches stock, ETF, crypto, and index prices using the yfinance library.

  • Features: History, Search, Metadata, Current Value
  • Identifier types: TICKER, ISIN
  • Key details: ticker.info for current price (no history() or fast_info), search caching (10 min TTL), currency caching (24h), sector/geographic metadata
  • πŸ“– Technical Details β†’
  • πŸ“– User Guide β†’

πŸ” JustETF (justetf)

Specialized ETF provider β€” fetches data from justetf.com including sector and geographic distributions.

  • Features: History, Search, Metadata, Current Value (Gettex)
  • Identifier types: ISIN
  • Key details: Cached ETF list for instant search, Gettex WebSocket for real-time quotes, geographic/sector distributions, pre-warm at startup
  • πŸ“– Technical Details β†’
  • πŸ“– User Guide β†’

🌐 CSS Scraper (cssscraper)

A versatile provider that can extract a current price from any public webpage using a CSS selector. Useful for tracking assets from niche sources without an API.


πŸ“… Scheduled Investment (scheduled_investment)

A synthetic, deterministic provider that calculates asset value based on a predefined interest schedule. No external calls, no DB access β€” pure math.

  • Features: Calculated History, Auto-generated Events (πŸ’΅ INTEREST, 🏁 MATURITY_SETTLEMENT)
  • Identifier type: AUTO_GENERATED
  • Key config: initial_value, schedule[], day_count, interest_type, late_interest
  • πŸ“– Technical Details β†’
  • πŸ“– User Guide β†’