Conversation
Owner
|
I hope to look at this around Wednesday, worst case Friday as the multi-provider architecture is revealing a lot of tech debt that I'm only reaping now 😭 |
Owner
|
Finally figured out a decent structure. Given the sheer scope of the refactoring, it might honestly be best to just checkout from master on a fresh branch. If you prefer to continue working on this branch, I can help rebase your branch if needed. Sorry for the conflicts 🙏 ! |
Bring the finance-query-python bindings to full parity with the Rust Ticker/Tickers/analytics API (deferred: Python-authored strategies, streaming, Arrow, Tickers.add/remove_symbols). - Tickers batch: dividends, splits, capital_gains, recommendations, financials, spark, options, chart, charts_range, news, quote(symbol), clear_cache helpers - Ticker reads: options, dividend_analytics, news_sentiment, filings, edgar_company_facts - Expose provider_id (PyProvider feature-gated mirror) and article sentiment - Analytics: indicators + indicator (PyIndicator, 40 ctors) + risk - Backtest: 6 prebuilt strategies + backtest/backtest_with_benchmark/portfolio - PyModel macro: handle generic F::Value formats + add py_model(skip) - Hand-written wrappers for macro-resistant types (CompanyFacts, IndicatorResult, BacktestResult/PortfolioResult) - Fix: enum mirrors now hashable (#[pyclass(hash, frozen)] + Hash) cargo default/python/python+sentiment/workspace clean; 144 lib tests; 68 pytest passed/10 skipped; mypy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Johnson-f
force-pushed
the
feat/python-bindings-crate-and-library
branch
from
June 24, 2026 07:55
d4a01ed to
49795c3
Compare
There was a problem hiding this comment.
zizmor found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Johnson-f
marked this pull request as draft
September 12, 2026 19:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new workspace crate
finance-query-pythonthat compiles the Rust libraryinto a native Python extension via PyO3 + maturin, published to PyPI as
finance-query-py. Closes #138.Verified live against Yahoo Finance / Alternative.me / SEC EDGAR — 51/51 surface
tests pass (see Test plan below).
What ships
Tickernew,builder,symbol,quote,chart,chart_range,dividends,splits,capital_gains,financials,news,recommendations,edgar_submissions, 3×clear_cache*TickerBuilderbuild()Tickers(batch)new,symbols,__len__,quotes,charts+BatchResult { data, errors }finance.*search,screener,trending,fear_and_greed,lookup,market_summary,hours,sector,currencies,news,industry,exchangesInterval,TimeRange,Frequency,StatementType,Region,ValueFormat,Sector,Screener,ExchangeCode,Industry,FearGreedLabel)FinanceQueryError+NetworkError,RateLimitError,SymbolNotFound,ParseError,ConfigError)to_dict()everywhere,to_dataframe()onChart,Candle,Dividend,Split,CapitalGain,OptionContract,FinancialStatement,News,SearchQuote,TrendingQuote, etc.enable_logging(level),edgar_init(email),edgar_init_with_config(...)Architecture
PyModelproc-macro infinance-query-derive(behind a newpythonfeature) generatesPy*wrappers from existing Rust structs. Attributes:eq,rename,dataframe = "columns",dataframe_from = "<field>". Handles primitives,String,Vec<T>,Option<T>,HashMap<K, V>, nested PyModel types,FormattedValue<T>(via concretePyFormattedValueF64/I64/U64/String), andserde_json::Value(auto-pythonized).finance-query) gains an optionalpythonfeature pulling inpyo3 0.27,pyo3-polars 0.26,pythonize 0.27. Default builds unchanged — Rust users pay nothing.pyo3-async-runtimes 0.27on a single shared tokio runtime initialized at module import.Repository layout
Phase 2 follow-ups (not in this PR)
ticker.options()—Optionswrapspub(crate) OptionChainContainer; needs hand-written wrapper or making the inner type public.ticker.edgar_company_facts()—CompanyFacts.HashMap<String, FactsByTaxonomy>(tuple struct value); PyModel needs to support that combo.PriceStream(always planned for Phase 2).backtesting,risknamespace ergonomics.Test plan
cargo check --features python— clean (40 doc-comment warnings, no errors)cargo test -p finance-query-derive --features python— 3 trybuild tests pass (ui_simple,ui_collections,ui_full)cd finance-query-python && maturin develop --release— builds wheelcp39-abi3-<platform>python3 -m pytest -m "not network"— 34 passedpython3 -m mypy— clean against the stubsfinance-query-py-v*tag (seefinance-query-python/README.md→ Releasing)Quickstart for reviewers
🤖 Generated with Claude Code