Skip to content

feat: add stock ownership etf_holdings REST endpoint#19

Open
kevinypfan wants to merge 4 commits into
mainfrom
feat/etf-holdings
Open

feat: add stock ownership etf_holdings REST endpoint#19
kevinypfan wants to merge 4 commits into
mainfrom
feat/etf-holdings

Conversation

@kevinypfan

Copy link
Copy Markdown
Collaborator

What

Python counterpart adding a client method for GET /v1.0/stock/ownership/etf-holdings/{symbol} (fugle-realtime issue #622). Client-side only.

API

stock.ownership.etf_holdings(symbol="0050", from_="...", to="...", sort="desc", code="...")

from is a Python keyword, so callers pass from_, rebuilt into a from query key (documented in README + commit).

Changes

  • New fugle_marketdata/rest/stock/ownership.py (Ownership(BaseRest) with etf_holdings).
  • ownership property on the stock REST client.
  • 4 new tests in tests/test_http_client.py (use a properly-mocked response). README usage example.

Note: relies on the test-mock fix (#fix/rest-test-mocks) for a green full suite.

🤖 Generated with Claude Code

kevinypfan and others added 4 commits June 22, 2026 17:30
Add client method for GET /v1.0/stock/ownership/etf-holdings/{symbol},
exposing daily ETF component holdings via stock.ownership.etf_holdings()
with optional from/to/sort/code query params. Since `from` is a reserved
Python keyword, callers pass it as `from_` (mapped to `from` in the query
string). Includes the ownership module, client property, tests, and README
usage example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the bespoke `from_` -> `from` remapping; callers pass `from` via
dict unpacking (`**{'from': ...}`) like every other endpoint in the SDK,
keeping the API consistent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Other endpoints aren't individually listed in the README; keep it consistent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant