{
  "id": "task_libraries:financial-data/python",
  "path": "/exapedia/python-financial-data-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python financial data libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python financial data libraries pull stock prices, crypto quotes, economic series, and company fundamentals into Python code. A client wraps a market data API or exchange feed and returns each series as a DataFrame or typed records. These libraries let trading bots, research notebooks, and AI agents work from current and historical market data."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python financial data libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#yfinance",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F124"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F128"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F126"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ccxt",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#databento",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#alpaca-py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#akshare",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fredapi",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#wbdata",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F238"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ib-async",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F257"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F266"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F261"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#yfinance",
          "label": [
            {
              "t": "text",
              "text": "yfinance"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F125"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Intraday OHLCV",
            "Native live client"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#yfinance",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F124"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ccxt",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#databento",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#alpaca-py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#akshare",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fredapi",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#wbdata",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F238"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ib-async",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F257"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F267"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F268"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "yfinance",
          "name": [
            {
              "t": "fact",
              "fact": "F124"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ranaroussi/yfinance"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/yfinance"
            },
            {
              "label": "Docs",
              "href": "https://ranaroussi.github.io/yfinance/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F11"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F127"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F126"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://ranaroussi.github.io/yfinance/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F124"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F12"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/Fincept-Corporation/FinceptTerminal",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F141"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def get_historical(symbol, start_date, end_date, interval='1d'):\n    \"\"\"Fetch historical data for a symbol with specified interval\n\n    Args:\n        symbol: Stock symbol (e.g., 'AAPL')\n        start_date: Start date (YYYY-MM-DD)\n        end_date: End date (YYYY-MM-DD)\n        interval: Data interval - valid values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo\n                  Note: Intraday data (< 1d) is only available for last 60 days\n    \"\"\"\n    try:\n        import io, contextlib\n        ticker = yf.Ticker(symbol)\n        _buf = io.StringIO()\n        with contextlib.redirect_stdout(_buf):\n            hist = ticker.history(start=start_date, end=end_date, interval=interval,\n                                  timeout=_NET_TIMEOUT)\n\n        if hist.empty:\n            return []\n\n        historical_data = []\n        for index, row in hist.iterrows():\n            # Guard every conversion the way get_batch_quotes already does — a\n            # single NaN bar must not take the whole series with it.\n            close = _num(row['Close'])\n            if close is None:\n                continue  # a bar with no close is not a price point\n            historical_data.append({\n                \"symbol\": symbol,\n                \"timestamp\": int(index.timestamp()),\n                \"open\": _num(row['Open']),\n                \"high\": _num(row['High']),\n                \"low\": _num(row['Low']),\n                \"close\": close,\n                \"volume\": _int(row['Volume'], 0),\n                \"adj_close\": close\n            })\n\n        return historical_data\n    except Exception as e:\n        return {\"error\": str(e), \"symbol\": symbol}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/Fincept-Corporation/FinceptTerminal/blob/68691b7577ce642009cdf2c1b4b0766ca9e37999/fincept-qt/scripts/yfinance_data.py#L157-L198",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F140"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20applications%20using%20yfinance%20for%20historical%20price%20and%20economic%20data%20retrieval&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F124"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import yfinance as yf\ndat = yf.Ticker(\"MSFT\")\ndat.history(period='1mo')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://ranaroussi.github.io/yfinance/",
                  "label": [
                    {
                      "t": "text",
                      "text": "yfinance.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F129"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "ccxt",
          "name": [
            {
              "t": "fact",
              "fact": "F143"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ccxt/ccxt"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/ccxt"
            },
            {
              "label": "Docs",
              "href": "https://docs.ccxt.com/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F150"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.ccxt.com/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/freqtrade/freqtrade",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F159"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@retrier\ndef fetch_bids_asks(self, symbols: list[str] | None = None, *, cached: bool = False) -> dict:\n    \"\"\"\n    :param symbols: List of symbols to fetch\n    :param cached: Allow cached result\n    :return: fetch_bids_asks result\n    \"\"\"\n    if not self.exchange_has(\"fetchBidsAsks\"):\n        return {}\n    if cached:\n        with self._cache_lock:\n            tickers = self._fetch_tickers_cache.get(\"fetch_bids_asks\")\n        if tickers:\n            return tickers\n    try:\n        tickers = self._api.fetch_bids_asks(symbols)\n        with self._cache_lock:\n            self._fetch_tickers_cache[\"fetch_bids_asks\"] = tickers\n        return tickers\n    except ccxt.NotSupported as e:\n        raise OperationalException(\n            f\"Exchange {self._api.name} does not support fetching bids/asks in batch. \"\n            f\"Message: {e}\"\n        ) from e\n    except ccxt.DDoSProtection as e:\n        raise DDosProtection(e) from e\n    except (ccxt.OperationFailed, ccxt.ExchangeError) as e:\n        raise TemporaryError(\n            f\"Could not load bids/asks due to {e.__class__.__name__}. Message: {e}\"\n        ) from e\n    except ccxt.BaseError as e:\n        raise OperationalException(e) from e\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/freqtrade/freqtrade/blob/b6d30da09b6745065bf60d464286ebb1b889ccbe/freqtrade/exchange/exchange.py#L2101-L2132",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F158"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=ccxt%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import ccxt\nexchange = ccxt.kraken()\nexchange.fetch_ticker('BTC/USD')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/ccxt/ccxt/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F148"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "databento",
          "name": [
            {
              "t": "fact",
              "fact": "F161"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/databento/databento-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/databento"
            },
            {
              "label": "Docs",
              "href": "https://databento.com/docs"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://databento.com/docs",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F161"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nautechsystems/nautilus_trader",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F177"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def databento_data(\n    symbols: list[str],\n    start_time: str,\n    end_time: str,\n    schema: str,\n    file_prefix: str,\n    *folders: str,\n    dataset: str = \"GLBX.MDP3\",\n    to_catalog: bool = True,\n    base_path: Path | None = None,\n    use_exchange_as_venue: bool = True,\n    load_databento_files_if_exist: bool = False,\n    as_legacy_cython: bool = False,\n    **kwargs: Any,\n) -> dict[str, Any]:\n    \"\"\"\n    Download and save Databento data and definition files, and optionally save the data\n    to a catalog.\n\n    Parameters\n    ----------\n    symbols : list[str]\n        The symbols to retrieve data for.\n    start_time : str\n        The start time of the data in ISO 8601 format.\n    end_time : str\n        The end time of the data in ISO 8601 format.\n    schema : str\n        The data schema to retrieve, either \"definition\" or another valid schema.\n    file_prefix : str\n        The prefix to use for the downloaded data files.\n    *folders : str\n        Additional folders to create in the data path.\n    dataset : str, optional\n        The Databento dataset to use, defaults to \"GLBX.MDP3\".\n    to_catalog : bool, optional\n        Whether to save the data to a catalog, defaults to True.\n    base_path : Path, optional\n        The base path to use for the data folder, defaults to None.\n    use_exchange_as_venue : bool, optional\n        Whether to use actual exchanges for instrument ids or GLBX, defaults to True.\n    load_databento_files_if_exist : bool, optional\n        Whether to load Databento files if they already exist, defaults to False.\n    as_legacy_cython : bool, optional\n        Whether to use legacy Cython format, defaults to False.\n    **kwargs : Any\n        Additional keyword arguments to pass to the Databento API.\n\n    Returns\n    -------\n    dict[str, Any]\n        A dictionary containing the downloaded data and metadata with keys:\n        - symbols: The list of symbols\n        - dataset: The dataset name\n        - schema: The schema name\n        - start: The start time\n        - end: The end time\n        - databento_definition_file: Path to definition file\n        - databento_data_file: Path to data file (if schema != \"definition\")\n        - databento_definition: Definition data object\n        - databento_data: Data object (if schema != \"definition\")\n        - catalog: Catalog object (if to_catalog=True)\n        - nautilus_definition: Processed definition data (if to_catalog=True)\n        - nautilus_data: Processed market data (if to_catalog=True)\n\n    Notes\n    -----\n    If schema is equal to 'definition' then no data is downloaded or saved to the catalog.\n\n    \"\"\"\n    used_path = create_data_folder(*folders, \"databento\", base_path=base_path)\n    definition_start_date, definition_end_date = databento_definition_dates(start_time, end_time)\n    definition_file_name = f\"{file_prefix}_definition.dbn.zst\"\n    definition_file = used_path / definition_file_name\n    if not definition_file.exists():\n        if client is None:\n            raise ValueError(\n                \"Databento client not initialized. Call init_databento_client() first.\",\n            )\n\n        definition = client.timeseries.get_range(\n            schema=\"definition\",\n            dataset=dataset,\n            symbols=symbols,\n            start=definition_start_date,\n            end=definition_end_date,\n            path=definition_file,\n            **kwargs,\n        )\n    else:\n        definition = load_databento_data(definition_file) if load_databento_files_if_exist else None\n\n    data = None\n    used_start_time = start_time.replace(\":\", \"-\").replace(\".\", \"-\")\n    used_end_time = end_time.replace(\":\", \"-\").replace(\".\", \"-\")\n    data_file_name = f\"{file_prefix}_{schema}_{used_start_time}_{used_end_time}.dbn.zst\"\n    data_file = used_path / data_file_name\n\n    if schema != \"definition\":\n        if not data_file.exists():\n            if client is None:\n                raise ValueError(\n                    \"Databento client not initialized. Call init_databento_client() first.\",\n                )\n\n            data = client.timeseries.get_range(\n                schema=schema,\n                dataset=dataset,\n                symbols=symbols,\n                start=start_time,\n                end=end_time,\n                path=data_file,\n                **kwargs,\n            )\n        else:\n            data = load_databento_data(data_file) if load_databento_files_if_exist else None\n\n    result = {\n        \"symbols\": symbols,\n        \"dataset\": dataset,\n        \"schema\": schema,\n        \"start\": start_time,\n        \"end\": end_time,\n        \"databento_definition_file\": definition_file,\n        \"databento_data_file\": data_file if schema != \"definition\" else None,\n        \"databento_definition\": definition,\n        \"databento_data\": data,\n    }\n\n    if schema == \"definition\":\n        del result[\"databento_data_file\"]\n        del result[\"databento_data\"]\n\n    if to_catalog:\n        catalog_data = save_data_to_catalog(\n            *folders,\n            definition_file=definition_file,\n            data_file=data_file,\n            base_path=base_path,\n            use_exchange_as_venue=use_exchange_as_venue,\n            as_legacy_cython=as_legacy_cython,\n        )\n        result.update(catalog_data)\n\n    return result\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/nautechsystems/nautilus_trader/blob/81cc70a2e4bc852376466eadae19d7de6053fab9/nautilus_trader/adapters/databento/data_utils.py#L98-L242",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=databento%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F161"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import databento as db\n\nclient = db.Historical('YOUR_API_KEY')\ndata = client.timeseries.get_range(\n    dataset='GLBX.MDP3',\n    symbols='ES.FUT',\n    stype_in='parent',\n    start='2022-06-10T14:30',\n    end='2022-06-10T14:40',\n)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/databento/databento-python/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F166"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "alpaca-py",
          "name": [
            {
              "t": "fact",
              "fact": "F179"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/alpacahq/alpaca-py"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/alpaca-py"
            },
            {
              "label": "Docs",
              "href": "https://alpaca.markets/sdks/python/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F186"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://alpaca.markets/sdks/python/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F179"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/alpacahq/alpaca-mcp-server",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F195"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@mcp.tool()\nasync def get_stock_latest_quote(\n    symbol_or_symbols: Union[str, List[str]],\n    feed: Optional[DataFeed] = None,    \n    currency: Optional[SupportedCurrencies] = None\n    ) -> str:\n    \"\"\"\n    Retrieves and formats the latest quote for one or more stocks.\n\n    Args:\n        symbol_or_symbols (Union[str, List[str]]): Stock ticker symbol(s) (e.g., 'AAPL' or ['AAPL', 'MSFT'])\n        feed (Optional[DataFeed]): Data feed source (IEX or SIP)\n        currency (Optional[SupportedCurrencies]): Currency for prices (default: USD)\n\n    Returns:\n        str: Latest bid/ask prices, sizes, and timestamp for each symbol\n    \"\"\"\n    _ensure_clients()\n    try:\n        # Validate input before making API call\n        symbols = [symbol_or_symbols] if isinstance(symbol_or_symbols, str) else list(symbol_or_symbols)\n        if not symbols:\n            return \"No symbols provided.\"\n\n        request_params = StockLatestQuoteRequest(\n            symbol_or_symbols=symbol_or_symbols,\n            feed=feed,\n            currency=currency\n        )\n\n        quotes = stock_historical_data_client.get_stock_latest_quote(request_params)\n\n        results: List[str] = []\n        for symbol in symbols:\n            quote = quotes.get(symbol)\n            if not quote:\n                results.append(f\"No quote data found for {symbol}.\")\n                continue\n\n            timestamp_value = getattr(quote, \"timestamp\", None)\n            timestamp = timestamp_value.isoformat() if hasattr(timestamp_value, \"isoformat\") else timestamp_value or \"N/A\"\n\n            results.extend([\n                f\"Symbol: {symbol}\",\n                f\"Ask Price: ${quote.ask_price:.2f}\",\n                f\"Bid Price: ${quote.bid_price:.2f}\",\n                f\"Ask Size: {quote.ask_size}\",\n                f\"Bid Size: {quote.bid_size}\",\n                f\"Timestamp: {timestamp}\",\n                \"\",\n            ])\n\n        return \"\\n\".join(results).strip()\n    except Exception as e:\n        symbols = [symbol_or_symbols] if isinstance(symbol_or_symbols, str) else list(symbol_or_symbols)\n        requested = \", \".join(symbols) if symbols else \"\"\n        return f\"Error fetching quote for {requested}: {str(e)}\"\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/alpacahq/alpaca-mcp-server/blob/101e57987a8d80e2c63e71edc83dbfb4e55d79d4/src/alpaca_mcp_server/server.py#L1252-L1308",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=alpaca-py%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F179"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from alpaca.data.historical import CryptoHistoricalDataClient\nfrom alpaca.data.requests import CryptoBarsRequest\nfrom alpaca.data.timeframe import TimeFrame\nfrom datetime import datetime\n\n# no keys required for crypto data\nclient = CryptoHistoricalDataClient()\n\nrequest_params = CryptoBarsRequest(\n                        symbol_or_symbols=[\"BTC/USD\", \"ETH/USD\"],\n                        timeframe=TimeFrame.Day,\n                        start=datetime(2022, 7, 1)\n                 )\n\nbars = client.get_crypto_bars(request_params)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/alpacahq/alpaca-py/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F184"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "akshare",
          "name": [
            {
              "t": "fact",
              "fact": "F197"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/akfamily/akshare"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/akshare"
            },
            {
              "label": "Docs",
              "href": "https://akshare.akfamily.xyz/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F204"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://akshare.akfamily.xyz/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F197"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/akfamily/akquant",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def fetch_etf_history(\n    symbol: str,\n    start_date: str = \"20200101\",\n    end_date: str = \"20251231\",\n) -> pd.DataFrame:\n    \"\"\"获取单只 ETF 历史行情并标准化为 AKQuant 可直接回测的列结构.\n\n    使用新浪数据源 ``fund_etf_hist_sina``（东方财富接口 ``fund_etf_hist_em``\n    近期常被断开连接）。新浪接口一次返回全部历史、不支持日期区间与复权参数，\n    这里在本地按日期截取。价格为不复权价格，除息日会有小幅跳空；\n    正式研究请自行复权。\n    \"\"\"\n    try:\n        import akshare as ak\n\n        df = ak.fund_etf_hist_sina(symbol=to_sina_etf_symbol(symbol))\n        if df.empty:\n            raise ValueError(\"返回空表\")\n    except Exception as exc:  # noqa: BLE001 - 示例容错，任何取数问题都回退\n        # 未安装 AKShare、断网、接口改名等: 改用合成数据，保证示例能跑通\n        print(f\"警告: AKShare 取数失败（{type(exc).__name__}: {exc}），改用合成数据\")\n        df = synthetic_daily(symbol, start_date, end_date)\n\n    required_columns = [\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\"]\n    missing_columns = [col for col in required_columns if col not in df.columns]\n    if missing_columns:\n        raise ValueError(\n            f\"ETF data for {symbol} is missing columns: {missing_columns}. \"\n            f\"Available columns: {df.columns.tolist()}\"\n        )\n\n    df = df[required_columns].copy()\n    df[\"date\"] = pd.to_datetime(df[\"date\"])\n    in_range = df[\"date\"].between(pd.Timestamp(start_date), pd.Timestamp(end_date))\n    df = df.loc[in_range].copy()\n    for col in [\"open\", \"high\", \"low\", \"close\", \"volume\"]:\n        df[col] = pd.to_numeric(df[col], errors=\"coerce\")\n    df = df.dropna(subset=[\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\"])\n    df[\"symbol\"] = symbol\n    return cast(pd.DataFrame, df.sort_values(\"date\").reset_index(drop=True))\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/akfamily/akquant/blob/cef0dc8f3845cb80ea0eed26518f5f4347ee7df1/examples/59_akshare_etf_rotation.py#L55-L94",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F215"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=akshare%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F197"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import akshare as ak\n\nstock_df = ak.stock_zh_a_hist_tx(\n    symbol=\"sz000001\", start_date=\"20261020\", end_date=\"20261027\", adjust=\"qfq\"\n)\nprint(stock_df)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/akfamily/akshare/blob/main/docs/tutorial.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "tutorial.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F202"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "fredapi",
          "name": [
            {
              "t": "fact",
              "fact": "F218"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/mortada/fredapi"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/fredapi"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F225"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/mortada/fredapi",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F218"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/RUC-NLPIR/FinSight",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def api_function(self, start: str = None):\n    fred = _get_fred()\n    if fred is None:\n        return [ToolResult(\n            name=self.name, description=\"FRED_API_KEY not set\",\n            data=None, source=\"FRED: CPIAUCSL\",\n        )]\n    try:\n        if start is None:\n            import datetime\n            start = (datetime.date.today() - datetime.timedelta(days=365 * 10)).isoformat()\n        series = fred.get_series(\"CPIAUCSL\", observation_start=start)\n        data = pd.DataFrame({\"date\": series.index, \"CPI\": series.values})\n    except Exception as e:\n        print(f\"Failed to fetch FRED CPI: {e}\")\n        data = None\n    return [ToolResult(\n        name=self.name, description=\"US CPI (All Urban, SA)\",\n        data=data, source=\"FRED: CPIAUCSL — https://fred.stlouisfed.org/series/CPIAUCSL\",\n    )]\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/RUC-NLPIR/FinSight/blob/8fc5bce28ac201c713219a47d30367c6a84342f4/src/tools/macro/us_macro.py#L48-L67",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F235"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=fredapi%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F218"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from fredapi import Fred\nfred = Fred(api_key='insert api key here')\ndata = fred.get_series('SP500')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/mortada/fredapi/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F223"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "wbdata",
          "name": [
            {
              "t": "fact",
              "fact": "F238"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/OliverSherouse/wbdata"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/wbdata"
            },
            {
              "label": "Docs",
              "href": "https://wbdata.readthedocs.io/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F245"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://wbdata.readthedocs.io/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F238"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/charliedream1/ai_quant_trade",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F255"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def demo_wbdata():\n    \"\"\"使用 wbdata 包获取数据\"\"\"\n    import wbdata\n\n    # 1. 查询国家列表\n    print(\"=\" * 60)\n    print(\"1. 查询国家列表（前10个）\")\n    print(\"=\" * 60)\n    countries = wbdata.get_countries()\n    for c in countries[:10]:\n        print(f\"  {c['id']}: {c['name']}\")\n\n    # 2. 获取中国GDP\n    print(\"\\n\" + \"=\" * 60)\n    print(\"2. 中国GDP（2010-2023）\")\n    print(\"=\" * 60)\n    result = wbdata.get_data('NY.GDP.MKTP.CD', country='CHN',\n                            date=('2010', '2023'))\n    # get_data 返回 Result 对象，可直接转为 DataFrame\n    df = pd.DataFrame(result)\n    if 'value' in df.columns:\n        df['value'] = pd.to_numeric(df['value'], errors='coerce')\n    print(df[['date', 'value']].sort_values('date') if 'date' in df.columns else df)\n\n    # 3. 多国多指标对比\n    print(\"\\n\" + \"=\" * 60)\n    print(\"3. 中美日 GDP与人口对比\")\n    print(\"=\" * 60)\n    indicators = {\n        'NY.GDP.MKTP.CD': 'GDP(美元)',\n        'SP.POP.TOTL': '人口',\n        'NY.GDP.PCAP.CD': '人均GDP(美元)'\n    }\n    # wbdata.get_dataframe 在某些版本中传入 country 列表会报\n    # TypeError: unhashable type: dict，改为逐国获取后合并\n    frames = []\n    for country_code in ['CHN', 'USA', 'JPN']:\n        df_c = wbdata.get_dataframe(indicators, country=country_code)\n        df_c['country'] = country_code\n        frames.append(df_c.reset_index())\n    df = pd.concat(frames, ignore_index=True)\n    df = df.sort_values(['country', 'date'], ascending=[True, False])\n    print(df.head(20))\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/charliedream1/ai_quant_trade/blob/f209fb360f02d3883ca0b4e010e44f1a3eac0089/egs_data/宏观经济/world_bank/world_bank_demo.py#L40-L82",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F254"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=wbdata%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F238"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import wbdata\nwbdata.get_sources()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/OliverSherouse/wbdata/blob/master/docs/index.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "index.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F243"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "ib-async",
          "name": [
            {
              "t": "fact",
              "fact": "F257"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ib-api-reloaded/ib_async"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/ib_async"
            },
            {
              "label": "Docs",
              "href": "https://ib-api-reloaded.github.io/ib_async/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F264"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F266"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F260"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://ib-api-reloaded.github.io/ib_async/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F257"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from ib_async import *\n# util.startLoop()  # uncomment this line when in a notebook\n\nib = IB()\nib.connect('127.0.0.1', 7497, clientId=1)\n\n# Request historical data\ncontract = Forex('EURUSD')\nbars = ib.reqHistoricalData(\n    contract, endDateTime='', durationStr='30 D',\n    barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True)\n\n# Convert to pandas dataframe (pandas needs to be installed):\ndf = util.df(bars)\nprint(df.head())\n\nib.disconnect()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/ib-api-reloaded/ib_async/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=ib_async%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F257"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F262"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python financial data library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#yfinance",
          "label": [
            {
              "t": "text",
              "text": "yfinance"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits research on stock prices and fundamentals from Yahoo Finance. "
        },
        {
          "t": "link",
          "href": "#ccxt",
          "label": [
            {
              "t": "text",
              "text": "CCXT"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits cryptocurrency exchanges through one unified API. "
        },
        {
          "t": "link",
          "href": "#databento",
          "label": [
            {
              "t": "text",
              "text": "Databento"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#alpaca-py",
          "label": [
            {
              "t": "text",
              "text": "Alpaca-py"
            }
          ]
        },
        {
          "t": "text",
          "text": " suit licensed historical and live market data."
        }
      ]
    },
    {
      "q": "What is yfinance?",
      "a": [
        {
          "t": "link",
          "href": "#yfinance",
          "label": [
            {
              "t": "text",
              "text": "yfinance"
            }
          ]
        },
        {
          "t": "text",
          "text": " retrieves market data, ticker information, and financial statements from Yahoo Finance. The code license of the library and the terms for using the data are separate."
        }
      ]
    },
    {
      "q": "What is Databento?",
      "a": [
        {
          "t": "link",
          "href": "#databento",
          "label": [
            {
              "t": "text",
              "text": "Databento"
            }
          ]
        },
        {
          "t": "text",
          "text": " is the official Python client for the Databento market data service. Historical data and live streams use separate clients, and each needs an API key and dataset permissions."
        }
      ]
    },
    {
      "q": "What is AKShare?",
      "a": [
        {
          "t": "link",
          "href": "#akshare",
          "label": [
            {
              "t": "text",
              "text": "AKShare"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a financial data interface library that returns pandas DataFrames from many sources, including Chinese equity, ETF, and macroeconomic series."
        }
      ]
    },
    {
      "q": "What is CCXT?",
      "a": [
        {
          "t": "link",
          "href": "#ccxt",
          "label": [
            {
              "t": "text",
              "text": "CCXT"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a cryptocurrency trading API that covers many exchanges through one interface. It fetches market data and candles where an exchange supports them, and its Pro version adds WebSocket streams."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, yfinance",
      "display": "yfinance",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, yfinance",
      "display": "16.8M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, yfinance",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, yfinance",
      "display": "1.8.0, Nov 2026",
      "asOf": "2026-11-03"
    },
    "F5": {
      "label": "Package release date, yfinance",
      "display": "Nov 2026",
      "asOf": "2026-11-03"
    },
    "F6": {
      "label": "Repository stars, yfinance",
      "display": "25.9K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Historical prices, yfinance",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Intraday prices, yfinance",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Financial statements, yfinance",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Install, yfinance",
      "display": "pip install yfinance",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "What it does, yfinance",
      "display": "Retrieves market data, ticker information, and financial statements from Yahoo Finance.",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths lead, yfinance",
      "display": "Downloads several tickers together",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths, yfinance",
      "display": "Retrieve market data for a list of ticker symbols.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, yfinance",
      "display": "Combines prices and financial statements",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, yfinance",
      "display": "Use a Ticker for price history and quarterly income statements.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations lead, yfinance",
      "display": "Intraday history has limited retention",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations, yfinance",
      "display": "Use another source when intraday data must extend beyond the retained window.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, yfinance",
      "display": "Prices adjust automatically by default",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, yfinance",
      "display": "Disable auto_adjust when the workflow requires unadjusted price columns.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Quickstart, yfinance",
      "display": "import yfinance as yf\ndat = yf.Ticker(\"MSFT\")\n\n\ndat = yf.Ticker(\"MSFT\")\ndat.info\ndat.calendar\ndat.analyst_price_targets\ndat.quarterly_income_stmt\ndat.history(period='1mo')\ndat.option_chain(dat.options[0]).calls\n\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function, yfinance",
      "display": "def get_historical(symbol, start_date, end_date, interval='1d'):\n    \"\"\"Fetch historical data for a symbol with specified interval\n\n    Args:\n        symbol: Stock symbol (e.g., 'AAPL')\n        start_date: Start date (YYYY-MM-DD)\n        end_date: End date (YYYY-MM-DD)\n        interval: Data interval - valid values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo\n                  Note: Intraday data (< 1d) is only available for last 60 days\n    \"\"\"\n    try:\n        import io, contextlib\n        ticker = yf.Ticker(symbol)\n        _buf = io.StringIO()\n        with contextlib.redirect_stdout(_buf):\n            hist = ticker.history(start=start_date, end=end_date, interval=interval,\n                                  timeout=_NET_TIMEOUT)\n\n        if hist.empty:\n            return []\n\n        historical_data = []\n        for index, row in hist.iterrows():\n            # Guard every conversion the way get_batch_quotes already does — a\n            # single NaN bar must not take the whole series with it.\n            close = _num(row['Close'])\n            if close is None:\n                continue  # a bar with no close is not a price point\n            historical_data.append({\n                \"symbol\": symbol,\n                \"timestamp\": int(index.timestamp()),\n                \"open\": _num(row['Open']),\n                \"high\": _num(row['High']),\n                \"low\": _num(row['Low']),\n                \"close\": close,\n                \"volume\": _int(row['Volume'], 0),\n                \"adj_close\": close\n            })\n\n        return historical_data\n    except Exception as e:\n        return {\"error\": str(e), \"symbol\": symbol}\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function reference, yfinance",
      "display": "yfinance_data.py · get_historical()",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project repository, yfinance",
      "display": "Fincept-Corporation/FinceptTerminal",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project stars, Fincept-Corporation/FinceptTerminal",
      "display": "33.9K",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project push date, Fincept-Corporation/FinceptTerminal",
      "display": "Nov 2026",
      "asOf": "2026-11-13"
    },
    "F26": {
      "label": "Library name, pandas-datareader",
      "display": "pandas-datareader",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Monthly downloads, pandas-datareader",
      "display": "654.0K",
      "asOf": "2026-11-16"
    },
    "F28": {
      "label": "License, pandas-datareader",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Package release, pandas-datareader",
      "display": "0.11.1, Jun 2026",
      "asOf": "2026-06-24"
    },
    "F30": {
      "label": "Package release date, pandas-datareader",
      "display": "Jun 2026",
      "asOf": "2026-06-24"
    },
    "F31": {
      "label": "Repository stars, pandas-datareader",
      "display": "3.3K",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Economic series, pandas-datareader",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Install, pandas-datareader",
      "display": "pip install pandas-datareader",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "What it does, pandas-datareader",
      "display": "Retrieves macroeconomic, central-bank, and factor datasets into pandas-compatible structures.",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "strengths lead, pandas-datareader",
      "display": "Connects maintained macroeconomic sources",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "strengths, pandas-datareader",
      "display": "Retrieve economic and policy data from multiple public statistical sources.",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths lead, pandas-datareader",
      "display": "Searches datasets and reads metadata",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths, pandas-datareader",
      "display": "Use the macro interface to search, describe, and retrieve datasets.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "limitations lead, pandas-datareader",
      "display": "Factor dates use different indexes",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "limitations, pandas-datareader",
      "display": "Handle PeriodIndex for annual and monthly factors, and DatetimeIndex otherwise.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "limitations lead, pandas-datareader",
      "display": "Provider schemas need separate handling",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations, pandas-datareader",
      "display": "Handle each source’s dimensions, metadata, and query semantics.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "Quickstart, pandas-datareader",
      "display": "from pandas_datareader.macro import (\n    describe_macro_dataset,\n    read_macro,\n    search_macro_datasets,\n)\n\neuro = read_macro(\"eurostat\", \"ert_h_eur_a\", start=\"2009-01-01\", end=\"2010-01-01\")\nflows = search_macro_datasets(\"oecd\", query=\"trade union\")\nmeta = describe_macro_dataset(\"eurostat\", \"ert_h_eur_a\")\n\n",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "Project function, pandas-datareader",
      "display": "@deprecated(msg=DATAREADER_DEPRECATION_WARNING)\ndef get_fama_french():\n    \"\"\"\n    Retrieve Fama-French factors via pandas-datareader\n    Returns\n    -------\n    pandas.DataFrame\n        Percent change of Fama-French factors\n    \"\"\"\n\n    start = '1/1/1970'\n    research_factors = web.DataReader('F-F_Research_Data_Factors_daily',\n                                      'famafrench', start=start)[0]\n    momentum_factor = web.DataReader('F-F_Momentum_Factor_daily',\n                                     'famafrench', start=start)[0]\n    five_factors = research_factors.join(momentum_factor).dropna()\n    five_factors /= 100.\n    five_factors.index = five_factors.index.tz_localize('utc')\n\n    five_factors.columns = five_factors.columns.str.strip()\n\n    return five_factors\n",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Project function reference, pandas-datareader",
      "display": "utils.py · get_fama_french()",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Project repository, pandas-datareader",
      "display": "quantopian/empyrical",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project stars, quantopian/empyrical",
      "display": "1.5K",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project push date, quantopian/empyrical",
      "display": "Jul 2024",
      "asOf": "2024-07-26"
    },
    "F49": {
      "label": "Library name, finnhub-python",
      "display": "finnhub-python",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Monthly downloads, finnhub-python",
      "display": "202.9K",
      "asOf": "2026-11-16"
    },
    "F51": {
      "label": "License, finnhub-python",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Package release, finnhub-python",
      "display": "2.4.30, Nov 2026",
      "asOf": "2026-11-05"
    },
    "F53": {
      "label": "Package release date, finnhub-python",
      "display": "Nov 2026",
      "asOf": "2026-11-05"
    },
    "F54": {
      "label": "Repository stars, finnhub-python",
      "display": "1.1K",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Historical prices, finnhub-python",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Financial statements, finnhub-python",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Economic series, finnhub-python",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Install, finnhub-python",
      "display": "pip install finnhub-python",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "What it does, finnhub-python",
      "display": "Provides a Python client for requesting stock-candle data from Finnhub.",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "strengths lead, finnhub-python",
      "display": "Retrieves financial statements and reports",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "strengths, finnhub-python",
      "display": "Fetch normalized statements or financial reports as originally reported.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "strengths lead, finnhub-python",
      "display": "Retrieves dated company news",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths, finnhub-python",
      "display": "Filter a company-news request by its start and end dates.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "limitations lead, finnhub-python",
      "display": "HTTP calls block the thread",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "limitations, finnhub-python",
      "display": "Offload requests when integrating this client into an asynchronous agent.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "Quickstart, finnhub-python",
      "display": "import finnhub\n\n# Setup client\nfinnhub_client = finnhub.Client(api_key=\"YOUR API KEY\")\n\n# Stock candles\nres = finnhub_client.stock_candles('AAPL', 'D', 1590988249, 1591852249)\nprint(res)\n\n",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "Project function, finnhub-python",
      "display": "def get_company_news(\n    symbol: Annotated[str, \"ticker symbol\"],\n    start_date: Annotated[\n        str,\n        \"start date of the search period for the company's basic financials, yyyy-mm-dd\",\n    ],\n    end_date: Annotated[\n        str,\n        \"end date of the search period for the company's basic financials, yyyy-mm-dd\",\n    ],\n    max_news_num: Annotated[\n        int, \"maximum number of news to return, default to 10\"\n    ] = 10,\n    save_path: SavePathType = None,\n) -> pd.DataFrame:\n    \"\"\"\n    retrieve market news related to designated company\n    \"\"\"\n    news = finnhub_client.company_news(symbol, _from=start_date, to=end_date)\n    if len(news) == 0:\n        print(f\"No company news found for symbol {symbol} from finnhub!\")\n    news = [\n        {\n            \"date\": datetime.fromtimestamp(n[\"datetime\"]).strftime(\"%Y%m%d%H%M%S\"),\n            \"headline\": n[\"headline\"],\n            \"summary\": n[\"summary\"],\n        }\n        for n in news\n    ]\n    # Randomly select a subset of news if the number of news exceeds the maximum\n    if len(news) > max_news_num:\n        news = random.choices(news, k=max_news_num)\n    news.sort(key=lambda x: x[\"date\"])\n    output = pd.DataFrame(news)\n    save_output(output, f\"company news of {symbol}\", save_path=save_path)\n\n    return output\n",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Project function reference, finnhub-python",
      "display": "finnhub_utils.py · get_company_news()",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Project repository, finnhub-python",
      "display": "AI4Finance-Foundation/FinRobot",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Project stars, AI4Finance-Foundation/FinRobot",
      "display": "8.4K",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project push date, AI4Finance-Foundation/FinRobot",
      "display": "Oct 2026",
      "asOf": "2026-10-24"
    },
    "F72": {
      "label": "Library name, alpha-vantage",
      "display": "alpha_vantage",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Monthly downloads, alpha-vantage",
      "display": "103.8K",
      "asOf": "2026-11-16"
    },
    "F74": {
      "label": "License, alpha-vantage",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Package release, alpha-vantage",
      "display": "3.0.0, Jul 2024",
      "asOf": "2024-07-18"
    },
    "F76": {
      "label": "Package release date, alpha-vantage",
      "display": "Jul 2024",
      "asOf": "2024-07-18"
    },
    "F77": {
      "label": "Repository stars, alpha-vantage",
      "display": "4.9K",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Historical prices, alpha-vantage",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Intraday prices, alpha-vantage",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Financial statements, alpha-vantage",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Economic series, alpha-vantage",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Install, alpha-vantage",
      "display": "pip install alpha-vantage pandas",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "What it does, alpha-vantage",
      "display": "Provides Python clients for price series, technical indicators, fundamentals, and economic data.",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths lead, alpha-vantage",
      "display": "Retrieves prices and technical indicators",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "strengths, alpha-vantage",
      "display": "Use TimeSeries and TechIndicators to fetch prices and calculated indicators.",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths lead, alpha-vantage",
      "display": "Retrieves economic indicator series",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths, alpha-vantage",
      "display": "Use EconIndicators for economic datasets such as gross domestic product.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "limitations lead, alpha-vantage",
      "display": "CSV support varies by endpoint",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "limitations, alpha-vantage",
      "display": "Use another return format for technical indicators and currency-exchange responses.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "limitations lead, alpha-vantage",
      "display": "Requests default to compact history",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "limitations, alpha-vantage",
      "display": "Set outputsize to full when the available longer series is needed.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Quickstart, alpha-vantage",
      "display": "from alpha_vantage.timeseries import TimeSeries\nfrom pprint import pprint\nts = TimeSeries(key='YOUR_API_KEY', output_format='pandas')\ndata, meta_data = ts.get_intraday(symbol='MSFT',interval='1min', outputsize='full')\npprint(data.head(2))\n",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Developer need",
      "display": "Several ticker histories",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Why choose yfinance",
      "display": "multi-ticker market downloads",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Developer need in introduction",
      "display": "several ticker histories",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "When to consider alpha-vantage",
      "display": "fetching service-calculated technical indicators is useful",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need",
      "display": "Macroeconomic research inputs",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Why choose pandas-datareader",
      "display": "maintained macroeconomic and policy sources",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need in introduction",
      "display": "macroeconomic research inputs",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "When to consider yfinance",
      "display": "ticker price histories are the main input",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "Prices and technical indicators",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose alpha-vantage",
      "display": "TimeSeries and TechIndicators clients",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "prices and technical indicators",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need",
      "display": "Statements and reported financials",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Why choose finnhub-python",
      "display": "normalized statements and original reports",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need in introduction",
      "display": "statements and reported financials",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "When to consider alpha-vantage",
      "display": "economic indicator series are central to the workflow",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Page introduction",
      "display": "Python financial data libraries let application developers retrieve financial and market datasets.",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "FAQ: Which Python financial data library should I choose?",
      "display": "yfinance downloads market data for multiple tickers.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Which Python financial data library should I choose?",
      "display": "pandas-datareader focuses on macroeconomic, policy, and factor sources.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Which Python financial data library should I choose?",
      "display": "alpha_vantage has price and technical-indicator clients.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Which Python financial data library should I choose?",
      "display": "finnhub-python retrieves financial statements and reported financials.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Does yfinance provide unlimited intraday history?",
      "display": "The download API limits how far intraday history extends into the past.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Does yfinance adjust price data by default?",
      "display": "auto_adjust is enabled by default and adjusts the OHLC price columns.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Is the yfinance end date included?",
      "display": "The start date is inclusive and the end date is exclusive.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: What is the current pandas-datareader focus?",
      "display": "Its maintained public interface covers macroeconomic, central-bank, policy, and factor sources.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Can pandas-datareader search economic datasets?",
      "display": "The macro module has functions for reading datasets, searching, and inspecting metadata.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Why do Fama-French datasets use different date indexes?",
      "display": "Annual and monthly data use PeriodIndex; other frequencies use DatetimeIndex.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Does alpha_vantage return a complete price history by default?",
      "display": "The time-series API defaults to compact output; full output requests the available longer series.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Can every alpha_vantage endpoint return CSV?",
      "display": "CSV is unavailable for ForeignExchange and TechIndicators calls.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Can every alpha_vantage endpoint return CSV?",
      "display": "FundamentalData also rejects the CSV output format.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can finnhub-python retrieve news over a date range?",
      "display": "company_news accepts _from and to dates for the requested symbol.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Can finnhub-python request financials as reported?",
      "display": "financials_reported requests reported company financials.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "Library name, yfinance",
      "display": "yfinance",
      "asOf": "2026-11-20"
    },
    "F125": {
      "label": "Monthly downloads, yfinance",
      "display": "17.0M",
      "asOf": "2026-11-20"
    },
    "F126": {
      "label": "License, yfinance",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F127": {
      "label": "Package release, yfinance",
      "display": "1.8.0",
      "asOf": "2026-11-20"
    },
    "F128": {
      "label": "Package release date, yfinance",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Install, yfinance",
      "display": "pip install yfinance",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Quickstart, yfinance",
      "display": "import yfinance as yf\ndat = yf.Ticker(\"MSFT\")\ndat.history(period='1mo')\n",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Repository stars, yfinance",
      "display": "25.9K",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Intraday OHLCV, yfinance",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Native live client, yfinance",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Data and API role, yfinance",
      "display": "Yahoo Finance market-price/fundamentals client with native ticker histories and WebSocket clients. SDK code license and upstream data-use permission are separate.",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Setup and service boundary, yfinance",
      "display": "Internet access; upstream data terms apply independently of Apache SDK license. This official API is intended for personal use.",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Actual project arguments and consumed returns, yfinance",
      "display": "{\"status\": \"verified\", \"arguments\": \"Original Fincept get_historical passes symbol to native Ticker,then start,end,interval,and timeout to history. Current history accepts these exact keyword inputs. Empty/error paths return [] or the original error object. _NET_TIMEOUT and _num are actual same-file helpers; redirected output does not alter native API calls. The unchanged docstring intraday60day statement is a broad consumer simplification,not a universal interval-specific availability guarantee.\", \"return_shape\": \"Current history returns pandas DataFrame with Date/Datetime index and Open,High,Low,Close,Volume. iterrows values are sanitized by original _num helper. auto_adjust=True is current default: source adj_close is assigned the same close value,not an independent unadjusted/adjusted price pair. No prices or account data requested.\"}",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Default price adjustment, yfinance",
      "display": "history uses auto_adjust=True by default. The selected consumer assigns its adj_close output from the same already-adjusted Close value; it does not return a separate independent unadjusted/adjusted pair.",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Data-use scope, yfinance",
      "display": "Official project says the Yahoo Finance API is intended for personal use only; Apache SDK grant does not grant rights to redistribute market data.",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Project function, yfinance",
      "display": "def get_historical(symbol, start_date, end_date, interval='1d'):\n    \"\"\"Fetch historical data for a symbol with specified interval\n\n    Args:\n        symbol: Stock symbol (e.g., 'AAPL')\n        start_date: Start date (YYYY-MM-DD)\n        end_date: End date (YYYY-MM-DD)\n        interval: Data interval - valid values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo\n                  Note: Intraday data (< 1d) is only available for last 60 days\n    \"\"\"\n    try:\n        import io, contextlib\n        ticker = yf.Ticker(symbol)\n        _buf = io.StringIO()\n        with contextlib.redirect_stdout(_buf):\n            hist = ticker.history(start=start_date, end=end_date, interval=interval,\n                                  timeout=_NET_TIMEOUT)\n\n        if hist.empty:\n            return []\n\n        historical_data = []\n        for index, row in hist.iterrows():\n            # Guard every conversion the way get_batch_quotes already does — a\n            # single NaN bar must not take the whole series with it.\n            close = _num(row['Close'])\n            if close is None:\n                continue  # a bar with no close is not a price point\n            historical_data.append({\n                \"symbol\": symbol,\n                \"timestamp\": int(index.timestamp()),\n                \"open\": _num(row['Open']),\n                \"high\": _num(row['High']),\n                \"low\": _num(row['Low']),\n                \"close\": close,\n                \"volume\": _int(row['Volume'], 0),\n                \"adj_close\": close\n            })\n\n        return historical_data\n    except Exception as e:\n        return {\"error\": str(e), \"symbol\": symbol}\n",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Project source file, yfinance",
      "display": "fincept-qt/scripts/yfinance_data.py",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Project full_name, yfinance",
      "display": "Fincept-Corporation/FinceptTerminal",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project stargazers_count, yfinance",
      "display": "33.9K",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Library name, ccxt",
      "display": "CCXT",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Monthly downloads, ccxt",
      "display": "2.7M",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "License, ccxt",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Package release, ccxt",
      "display": "4.5.93",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Package release date, ccxt",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Install, ccxt",
      "display": "pip install ccxt",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Quickstart, ccxt",
      "display": "import ccxt\nexchange = ccxt.kraken()\nexchange.fetch_ticker('BTC/USD')\n",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Official description, ccxt",
      "display": "Trades and reads market data on more than 100 cryptocurrency exchanges through one API.",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Quickstart source file, ccxt",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Repository stars, ccxt",
      "display": "44.9K",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Intraday OHLCV, ccxt",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Native live client, ccxt",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Data and API role, ccxt",
      "display": "Unified cryptocurrency exchange market-data and trading SDK. The selected read-only example polls candles; exchange support is capability-specific and whole-package downloads also include trading.",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Setup and service boundary, ccxt",
      "display": "Public market-data endpoint availability/rate limits vary by exchange and jurisdiction. No private key required for the shown public ticker method.",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Project function, ccxt",
      "display": "@retrier\ndef fetch_bids_asks(self, symbols: list[str] | None = None, *, cached: bool = False) -> dict:\n    \"\"\"\n    :param symbols: List of symbols to fetch\n    :param cached: Allow cached result\n    :return: fetch_bids_asks result\n    \"\"\"\n    if not self.exchange_has(\"fetchBidsAsks\"):\n        return {}\n    if cached:\n        with self._cache_lock:\n            tickers = self._fetch_tickers_cache.get(\"fetch_bids_asks\")\n        if tickers:\n            return tickers\n    try:\n        tickers = self._api.fetch_bids_asks(symbols)\n        with self._cache_lock:\n            self._fetch_tickers_cache[\"fetch_bids_asks\"] = tickers\n        return tickers\n    except ccxt.NotSupported as e:\n        raise OperationalException(\n            f\"Exchange {self._api.name} does not support fetching bids/asks in batch. \"\n            f\"Message: {e}\"\n        ) from e\n    except ccxt.DDoSProtection as e:\n        raise DDosProtection(e) from e\n    except (ccxt.OperationFailed, ccxt.ExchangeError) as e:\n        raise TemporaryError(\n            f\"Could not load bids/asks due to {e.__class__.__name__}. Message: {e}\"\n        ) from e\n    except ccxt.BaseError as e:\n        raise OperationalException(e) from e\n",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Project source file, ccxt",
      "display": "freqtrade/exchange/exchange.py",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project full_name, ccxt",
      "display": "freqtrade/freqtrade",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project stargazers_count, ccxt",
      "display": "56.9K",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Library name, databento",
      "display": "Databento",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Monthly downloads, databento",
      "display": "1.4M",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "License, databento",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Package release, databento",
      "display": "0.90.0",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Package release date, databento",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Install, databento",
      "display": "pip install -U databento",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Quickstart, databento",
      "display": "import databento as db\n\nclient = db.Historical('YOUR_API_KEY')\ndata = client.timeseries.get_range(\n    dataset='GLBX.MDP3',\n    symbols='ES.FUT',\n    stype_in='parent',\n    start='2022-06-10T14:30',\n    end='2022-06-10T14:40',\n)\n",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Official description, databento",
      "display": "Provides the official Python client for Databento.",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Quickstart source file, databento",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Repository stars, databento",
      "display": "314",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Intraday OHLCV, databento",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Native live client, databento",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Data and API role, databento",
      "display": "Historical and live market-data SDK with structured schemas including market-by-order and intraday OHLCV. API key,dataset permissions,and billing are separate prerequisites.",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Setup and service boundary, databento",
      "display": "Actual Databento API key and dataset access required. Historical request may incur data charges; no request executed.",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Project function, databento",
      "display": "def databento_data(\n    symbols: list[str],\n    start_time: str,\n    end_time: str,\n    schema: str,\n    file_prefix: str,\n    *folders: str,\n    dataset: str = \"GLBX.MDP3\",\n    to_catalog: bool = True,\n    base_path: Path | None = None,\n    use_exchange_as_venue: bool = True,\n    load_databento_files_if_exist: bool = False,\n    as_legacy_cython: bool = False,\n    **kwargs: Any,\n) -> dict[str, Any]:\n    \"\"\"\n    Download and save Databento data and definition files, and optionally save the data\n    to a catalog.\n\n    Parameters\n    ----------\n    symbols : list[str]\n        The symbols to retrieve data for.\n    start_time : str\n        The start time of the data in ISO 8601 format.\n    end_time : str\n        The end time of the data in ISO 8601 format.\n    schema : str\n        The data schema to retrieve, either \"definition\" or another valid schema.\n    file_prefix : str\n        The prefix to use for the downloaded data files.\n    *folders : str\n        Additional folders to create in the data path.\n    dataset : str, optional\n        The Databento dataset to use, defaults to \"GLBX.MDP3\".\n    to_catalog : bool, optional\n        Whether to save the data to a catalog, defaults to True.\n    base_path : Path, optional\n        The base path to use for the data folder, defaults to None.\n    use_exchange_as_venue : bool, optional\n        Whether to use actual exchanges for instrument ids or GLBX, defaults to True.\n    load_databento_files_if_exist : bool, optional\n        Whether to load Databento files if they already exist, defaults to False.\n    as_legacy_cython : bool, optional\n        Whether to use legacy Cython format, defaults to False.\n    **kwargs : Any\n        Additional keyword arguments to pass to the Databento API.\n\n    Returns\n    -------\n    dict[str, Any]\n        A dictionary containing the downloaded data and metadata with keys:\n        - symbols: The list of symbols\n        - dataset: The dataset name\n        - schema: The schema name\n        - start: The start time\n        - end: The end time\n        - databento_definition_file: Path to definition file\n        - databento_data_file: Path to data file (if schema != \"definition\")\n        - databento_definition: Definition data object\n        - databento_data: Data object (if schema != \"definition\")\n        - catalog: Catalog object (if to_catalog=True)\n        - nautilus_definition: Processed definition data (if to_catalog=True)\n        - nautilus_data: Processed market data (if to_catalog=True)\n\n    Notes\n    -----\n    If schema is equal to 'definition' then no data is downloaded or saved to the catalog.\n\n    \"\"\"\n    used_path = create_data_folder(*folders, \"databento\", base_path=base_path)\n    definition_start_date, definition_end_date = databento_definition_dates(start_time, end_time)\n    definition_file_name = f\"{file_prefix}_definition.dbn.zst\"\n    definition_file = used_path / definition_file_name\n    if not definition_file.exists():\n        if client is None:\n            raise ValueError(\n                \"Databento client not initialized. Call init_databento_client() first.\",\n            )\n\n        definition = client.timeseries.get_range(\n            schema=\"definition\",\n            dataset=dataset,\n            symbols=symbols,\n            start=definition_start_date,\n            end=definition_end_date,\n            path=definition_file,\n            **kwargs,\n        )\n    else:\n        definition = load_databento_data(definition_file) if load_databento_files_if_exist else None\n\n    data = None\n    used_start_time = start_time.replace(\":\", \"-\").replace(\".\", \"-\")\n    used_end_time = end_time.replace(\":\", \"-\").replace(\".\", \"-\")\n    data_file_name = f\"{file_prefix}_{schema}_{used_start_time}_{used_end_time}.dbn.zst\"\n    data_file = used_path / data_file_name\n\n    if schema != \"definition\":\n        if not data_file.exists():\n            if client is None:\n                raise ValueError(\n                    \"Databento client not initialized. Call init_databento_client() first.\",\n                )\n\n            data = client.timeseries.get_range(\n                schema=schema,\n                dataset=dataset,\n                symbols=symbols,\n                start=start_time,\n                end=end_time,\n                path=data_file,\n                **kwargs,\n            )\n        else:\n            data = load_databento_data(data_file) if load_databento_files_if_exist else None\n\n    result = {\n        \"symbols\": symbols,\n        \"dataset\": dataset,\n        \"schema\": schema,\n        \"start\": start_time,\n        \"end\": end_time,\n        \"databento_definition_file\": definition_file,\n        \"databento_data_file\": data_file if schema != \"definition\" else None,\n        \"databento_definition\": definition,\n        \"databento_data\": data,\n    }\n\n    if schema == \"definition\":\n        del result[\"databento_data_file\"]\n        del result[\"databento_data\"]\n\n    if to_catalog:\n        catalog_data = save_data_to_catalog(\n            *folders,\n            definition_file=definition_file,\n            data_file=data_file,\n            base_path=base_path,\n            use_exchange_as_venue=use_exchange_as_venue,\n            as_legacy_cython=as_legacy_cython,\n        )\n        result.update(catalog_data)\n\n    return result\n",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Project source file, databento",
      "display": "nautilus_trader/adapters/databento/data_utils.py",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Project full_name, databento",
      "display": "nautechsystems/nautilus_trader",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project stargazers_count, databento",
      "display": "31.7K",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Library name, alpaca-py",
      "display": "Alpaca-py",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Monthly downloads, alpaca-py",
      "display": "1.4M",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "License, alpaca-py",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Package release, alpaca-py",
      "display": "0.45.0",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Package release date, alpaca-py",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Install, alpaca-py",
      "display": "pip install alpaca-py",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Quickstart, alpaca-py",
      "display": "from alpaca.data.historical import CryptoHistoricalDataClient\nfrom alpaca.data.requests import CryptoBarsRequest\nfrom alpaca.data.timeframe import TimeFrame\nfrom datetime import datetime\n\n# no keys required for crypto data\nclient = CryptoHistoricalDataClient()\n\nrequest_params = CryptoBarsRequest(\n                        symbol_or_symbols=[\"BTC/USD\", \"ETH/USD\"],\n                        timeframe=TimeFrame.Day,\n                        start=datetime(2022, 7, 1)\n                 )\n\nbars = client.get_crypto_bars(request_params)\n",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Official description, alpaca-py",
      "display": "Provides the official Python SDK for Alpaca APIs.",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Quickstart source file, alpaca-py",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Repository stars, alpaca-py",
      "display": "1.6K",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Intraday OHLCV, alpaca-py",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Native live client, alpaca-py",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Data and API role, alpaca-py",
      "display": "SDK with dedicated stock,crypto,and option market-data clients alongside separate broker/trading APIs. Example uses stock bars; shortest official starter uses keyless crypto bars.",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Setup and service boundary, alpaca-py",
      "display": "The shown crypto historical example explicitly needs no keys; stock/option/news clients have different credential and entitlement requirements.",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Project function, alpaca-py",
      "display": "@mcp.tool()\nasync def get_stock_latest_quote(\n    symbol_or_symbols: Union[str, List[str]],\n    feed: Optional[DataFeed] = None,    \n    currency: Optional[SupportedCurrencies] = None\n    ) -> str:\n    \"\"\"\n    Retrieves and formats the latest quote for one or more stocks.\n\n    Args:\n        symbol_or_symbols (Union[str, List[str]]): Stock ticker symbol(s) (e.g., 'AAPL' or ['AAPL', 'MSFT'])\n        feed (Optional[DataFeed]): Data feed source (IEX or SIP)\n        currency (Optional[SupportedCurrencies]): Currency for prices (default: USD)\n\n    Returns:\n        str: Latest bid/ask prices, sizes, and timestamp for each symbol\n    \"\"\"\n    _ensure_clients()\n    try:\n        # Validate input before making API call\n        symbols = [symbol_or_symbols] if isinstance(symbol_or_symbols, str) else list(symbol_or_symbols)\n        if not symbols:\n            return \"No symbols provided.\"\n\n        request_params = StockLatestQuoteRequest(\n            symbol_or_symbols=symbol_or_symbols,\n            feed=feed,\n            currency=currency\n        )\n\n        quotes = stock_historical_data_client.get_stock_latest_quote(request_params)\n\n        results: List[str] = []\n        for symbol in symbols:\n            quote = quotes.get(symbol)\n            if not quote:\n                results.append(f\"No quote data found for {symbol}.\")\n                continue\n\n            timestamp_value = getattr(quote, \"timestamp\", None)\n            timestamp = timestamp_value.isoformat() if hasattr(timestamp_value, \"isoformat\") else timestamp_value or \"N/A\"\n\n            results.extend([\n                f\"Symbol: {symbol}\",\n                f\"Ask Price: ${quote.ask_price:.2f}\",\n                f\"Bid Price: ${quote.bid_price:.2f}\",\n                f\"Ask Size: {quote.ask_size}\",\n                f\"Bid Size: {quote.bid_size}\",\n                f\"Timestamp: {timestamp}\",\n                \"\",\n            ])\n\n        return \"\\n\".join(results).strip()\n    except Exception as e:\n        symbols = [symbol_or_symbols] if isinstance(symbol_or_symbols, str) else list(symbol_or_symbols)\n        requested = \", \".join(symbols) if symbols else \"\"\n        return f\"Error fetching quote for {requested}: {str(e)}\"\n",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Project source file, alpaca-py",
      "display": "src/alpaca_mcp_server/server.py",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Project full_name, alpaca-py",
      "display": "alpacahq/alpaca-mcp-server",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Project stargazers_count, alpaca-py",
      "display": "1.1K",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Library name, akshare",
      "display": "AKShare",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Monthly downloads, akshare",
      "display": "1.2M",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "License, akshare",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Package release, akshare",
      "display": "1.20.65",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Package release date, akshare",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Install, akshare",
      "display": "pip install akshare --upgrade",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Quickstart, akshare",
      "display": "import akshare as ak\n\nstock_df = ak.stock_zh_a_hist_tx(\n    symbol=\"sz000001\", start_date=\"20261020\", end_date=\"20261027\", adjust=\"qfq\"\n)\nprint(stock_df)\n",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Official description, akshare",
      "display": "Provides a financial data interface library for Python.",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Quickstart source file, akshare",
      "display": "docs/tutorial.md",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Repository stars, akshare",
      "display": "23.4K",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Intraday OHLCV, akshare",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Native live client, akshare",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Data and API role, akshare",
      "display": "Many source-specific financial/economic retrieval interfaces returning pandas DataFrames,including Chinese equity/ETF and macro series. Endpoint names and native columns are not standardized across sources.",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Setup and service boundary, akshare",
      "display": "Python3.11.5+ and access to the upstream source website. Names/columns vary by interface. The first-call Tencent daily endpoint is distinct from Sina ETF example.",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Actual project arguments and consumed returns, akshare",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole40-line AKQuant fetch_etf_history uses current fund_etf_hist_sina(symbol=to_sina_etf_symbol(symbol)). Actual helper prefixes six-digit ETF codes sh/sz. Native API takes symbol only; the original code deliberately filters start/end locally and does not pass nonexistent date/adjust keywords. Actual native columns date/open/high/low/close/volume are selected and normalized to numeric/date.\", \"return_shape\": \"Returns a cleaned pandas DataFrame with symbol column,sorted dates,and reset index. On SDK/import/network/empty-data failure the unchanged consumer generates synthetic_daily data and prints a warning: this fallback is synthetic,not fetched prices,and must remain clearly distinguished. Original comments correctly identify unadjusted prices; this is not a corporate-action-adjusted return calculation. No data fetched or files written by running the consumer.\"}",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Removed endpoint name, akshare",
      "display": "stock_zh_a_hist was renamed to stock_zh_a_hist_em at1.20.46 and now raises AttributeError. The selected ETF example uses current fund_etf_hist_sina; starter uses stock_zh_a_hist_tx.",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Example data fallback, akshare",
      "display": "Selected original ETF application explicitly falls back to deterministic synthetic_daily on import/network/empty-data failures. Such rows are synthetic and cannot be described as downloaded financial observations.",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Project function, akshare",
      "display": "def fetch_etf_history(\n    symbol: str,\n    start_date: str = \"20200101\",\n    end_date: str = \"20251231\",\n) -> pd.DataFrame:\n    \"\"\"获取单只 ETF 历史行情并标准化为 AKQuant 可直接回测的列结构.\n\n    使用新浪数据源 ``fund_etf_hist_sina``（东方财富接口 ``fund_etf_hist_em``\n    近期常被断开连接）。新浪接口一次返回全部历史、不支持日期区间与复权参数，\n    这里在本地按日期截取。价格为不复权价格，除息日会有小幅跳空；\n    正式研究请自行复权。\n    \"\"\"\n    try:\n        import akshare as ak\n\n        df = ak.fund_etf_hist_sina(symbol=to_sina_etf_symbol(symbol))\n        if df.empty:\n            raise ValueError(\"返回空表\")\n    except Exception as exc:  # noqa: BLE001 - 示例容错，任何取数问题都回退\n        # 未安装 AKShare、断网、接口改名等: 改用合成数据，保证示例能跑通\n        print(f\"警告: AKShare 取数失败（{type(exc).__name__}: {exc}），改用合成数据\")\n        df = synthetic_daily(symbol, start_date, end_date)\n\n    required_columns = [\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\"]\n    missing_columns = [col for col in required_columns if col not in df.columns]\n    if missing_columns:\n        raise ValueError(\n            f\"ETF data for {symbol} is missing columns: {missing_columns}. \"\n            f\"Available columns: {df.columns.tolist()}\"\n        )\n\n    df = df[required_columns].copy()\n    df[\"date\"] = pd.to_datetime(df[\"date\"])\n    in_range = df[\"date\"].between(pd.Timestamp(start_date), pd.Timestamp(end_date))\n    df = df.loc[in_range].copy()\n    for col in [\"open\", \"high\", \"low\", \"close\", \"volume\"]:\n        df[col] = pd.to_numeric(df[col], errors=\"coerce\")\n    df = df.dropna(subset=[\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\"])\n    df[\"symbol\"] = symbol\n    return cast(pd.DataFrame, df.sort_values(\"date\").reset_index(drop=True))\n",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Project source file, akshare",
      "display": "examples/59_akshare_etf_rotation.py",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Project full_name, akshare",
      "display": "akfamily/akquant",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project stargazers_count, akshare",
      "display": "2.6K",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Library name, fredapi",
      "display": "fredapi",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Monthly downloads, fredapi",
      "display": "1.1M",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "License, fredapi",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Package release, fredapi",
      "display": "0.5.2",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Package release date, fredapi",
      "display": "May 2024",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Install, fredapi",
      "display": "pip install fredapi",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Quickstart, fredapi",
      "display": "from fredapi import Fred\nfred = Fred(api_key='insert api key here')\ndata = fred.get_series('SP500')\n",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Official description, fredapi",
      "display": "Retrieves Federal Reserve Economic Data from the St. Louis Fed.",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Quickstart source file, fredapi",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Repository stars, fredapi",
      "display": "1.7K",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Intraday OHLCV, fredapi",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Native live client, fredapi",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Data and API role, fredapi",
      "display": "FRED economic-series client with ALFRED release-vintage queries for values known at a date,distinct from simply selecting observation dates.",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Setup and service boundary, fredapi",
      "display": "Actual FRED API key required; the code contains a placeholder only.",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Actual project arguments and consumed returns, fredapi",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole original USCPI.api_function gets its native Fred instance from the same-file _get_fred helper,which constructs Fred(api_key=...) and caches it. The qualified task class is USCPI. It calls get_series(\\\"CPIAUCSL\\\",observation_start=start) with explicit start or a computed ISO date. Current0.5.2 accepts observation_start and parses it to date. Missing credential and caught exception paths are retained.\", \"return_shape\": \"get_series returns pandas Series indexed by observation datetime; source consumes .index and .values to form date/CPI DataFrame,wrapped in the application ToolResult. It does not request vintage data or claim this series is unrevised. _get_fred is a local helper,not a second SDK call. One-call exception applies to the whole bounded task method,not a fabricated wrapper.\"}",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Observation dates versus release vintages, fredapi",
      "display": "get_series_as_of_date filters release realtime_start at the specified as-of date; get_series_all_releases exposes successive release values. Current get_series is latest available,not an automatic historical knowledge snapshot.",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Project function, fredapi",
      "display": "async def api_function(self, start: str = None):\n    fred = _get_fred()\n    if fred is None:\n        return [ToolResult(\n            name=self.name, description=\"FRED_API_KEY not set\",\n            data=None, source=\"FRED: CPIAUCSL\",\n        )]\n    try:\n        if start is None:\n            import datetime\n            start = (datetime.date.today() - datetime.timedelta(days=365 * 10)).isoformat()\n        series = fred.get_series(\"CPIAUCSL\", observation_start=start)\n        data = pd.DataFrame({\"date\": series.index, \"CPI\": series.values})\n    except Exception as e:\n        print(f\"Failed to fetch FRED CPI: {e}\")\n        data = None\n    return [ToolResult(\n        name=self.name, description=\"US CPI (All Urban, SA)\",\n        data=data, source=\"FRED: CPIAUCSL — https://fred.stlouisfed.org/series/CPIAUCSL\",\n    )]\n",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Project source file, fredapi",
      "display": "src/tools/macro/us_macro.py",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Project full_name, fredapi",
      "display": "RUC-NLPIR/FinSight",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Project stargazers_count, fredapi",
      "display": "279",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Library name, wbdata",
      "display": "wbdata",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Monthly downloads, wbdata",
      "display": "981.7K",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "License, wbdata",
      "display": "GPL-2.0",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Package release, wbdata",
      "display": "1.1.0",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Package release date, wbdata",
      "display": "Oct 2025",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Install, wbdata",
      "display": "pip3 install -U wbdata",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Quickstart, wbdata",
      "display": "import wbdata\nwbdata.get_sources()\n",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Official description, wbdata",
      "display": "Accesses World Bank data.",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Quickstart source file, wbdata",
      "display": "docs/index.md",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Repository stars, wbdata",
      "display": "214",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Intraday OHLCV, wbdata",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Native live client, wbdata",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Data and API role, wbdata",
      "display": "World Bank country/indicator client,including financial development and macroeconomic indicators. Generic catalogue descriptions do not imply every indicator supports every requested periodicity.",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Setup and service boundary, wbdata",
      "display": "Public World Bank metadata API; no API key for this basic source-list call. Install pandas separately for get_dataframe.",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Actual project arguments and consumed returns, wbdata",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole World Bank application calls current top-level default-client aliases. get_countries returns SearchResult list supporting slice/iteration/id/name. get_data accepts indicator NY.GDP.MKTP.CD,country CHN,and date=(\\\"2010\\\",\\\"2023\\\") tuple under current1.1 API; no removed data_date argument. get_dataframe accepts indicator-name mapping and one country per iteration; default keep_levels=False removes constant country index,leaving date for reset_index. Source adds its explicit country-code column before concatenating.\", \"return_shape\": \"Raw GDP observations are dictionaries converted to DataFrame with value coercion; native get_dataframe yields one column per mapped indicator. Three country frames sort by source-added country and date. GDP values are current US dollars,not real inflation-adjusted growth. No API request or country series downloaded.\"}",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Project function, wbdata",
      "display": "def demo_wbdata():\n    \"\"\"使用 wbdata 包获取数据\"\"\"\n    import wbdata\n\n    # 1. 查询国家列表\n    print(\"=\" * 60)\n    print(\"1. 查询国家列表（前10个）\")\n    print(\"=\" * 60)\n    countries = wbdata.get_countries()\n    for c in countries[:10]:\n        print(f\"  {c['id']}: {c['name']}\")\n\n    # 2. 获取中国GDP\n    print(\"\\n\" + \"=\" * 60)\n    print(\"2. 中国GDP（2010-2023）\")\n    print(\"=\" * 60)\n    result = wbdata.get_data('NY.GDP.MKTP.CD', country='CHN',\n                            date=('2010', '2023'))\n    # get_data 返回 Result 对象，可直接转为 DataFrame\n    df = pd.DataFrame(result)\n    if 'value' in df.columns:\n        df['value'] = pd.to_numeric(df['value'], errors='coerce')\n    print(df[['date', 'value']].sort_values('date') if 'date' in df.columns else df)\n\n    # 3. 多国多指标对比\n    print(\"\\n\" + \"=\" * 60)\n    print(\"3. 中美日 GDP与人口对比\")\n    print(\"=\" * 60)\n    indicators = {\n        'NY.GDP.MKTP.CD': 'GDP(美元)',\n        'SP.POP.TOTL': '人口',\n        'NY.GDP.PCAP.CD': '人均GDP(美元)'\n    }\n    # wbdata.get_dataframe 在某些版本中传入 country 列表会报\n    # TypeError: unhashable type: dict，改为逐国获取后合并\n    frames = []\n    for country_code in ['CHN', 'USA', 'JPN']:\n        df_c = wbdata.get_dataframe(indicators, country=country_code)\n        df_c['country'] = country_code\n        frames.append(df_c.reset_index())\n    df = pd.concat(frames, ignore_index=True)\n    df = df.sort_values(['country', 'date'], ascending=[True, False])\n    print(df.head(20))\n",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Project source file, wbdata",
      "display": "egs_data/宏观经济/world_bank/world_bank_demo.py",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Project full_name, wbdata",
      "display": "charliedream1/ai_quant_trade",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Project stargazers_count, wbdata",
      "display": "6.8K",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Library name, ib_async",
      "display": "ib_async",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Monthly downloads, ib_async",
      "display": "769.2K",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "License, ib_async",
      "display": "BSD-2-Clause",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Package release, ib_async",
      "display": "2.1.0",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Package release date, ib_async",
      "display": "Dec 2025",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Install, ib_async",
      "display": "pip install ib_async",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Quickstart, ib_async",
      "display": "from ib_async import *\n# util.startLoop()  # uncomment this line when in a notebook\n\nib = IB()\nib.connect('127.0.0.1', 7497, clientId=1)\n\n# Request historical data\ncontract = Forex('EURUSD')\nbars = ib.reqHistoricalData(\n    contract, endDateTime='', durationStr='30 D',\n    barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True)\n\n# Convert to pandas dataframe (pandas needs to be installed):\ndf = util.df(bars)\nprint(df.head())\n\nib.disconnect()\n",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Official description, ib_async",
      "display": "Provides a sync and async framework for the Interactive Brokers API.",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Quickstart source file, ib_async",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "Repository stars, ib_async",
      "display": "1.8K",
      "asOf": "2026-11-20"
    },
    "F267": {
      "label": "Intraday OHLCV, ib_async",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F268": {
      "label": "Native live client, ib_async",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F269": {
      "label": "Data and API role, ib_async",
      "display": "IBKR TWS/IB Gateway client with native historical bars and streaming Ticker objects. Local broker session/API enablement and data entitlements are required independently of installing the BSD SDK.",
      "asOf": "2026-11-20"
    },
    "F270": {
      "label": "Setup and service boundary, ib_async",
      "display": "Running TWS or IB Gateway with enabled socket API at configured host/port,actual account/session,and relevant market-data permissions. Python3.10+. util.df requires pandas. Placeholder local port7497 is the official example default,not an auto-discovered live account.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python financial data libraries yfinance pandas-datareader alpha-vantage finnhub-python code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
