Skip to content

feat: add ASX corporate actions endpoint#75

Open
alexpipipi wants to merge 1 commit into
mainfrom
feat/asx-corporate-actions
Open

feat: add ASX corporate actions endpoint#75
alexpipipi wants to merge 1 commit into
mainfrom
feat/asx-corporate-actions

Conversation

@alexpipipi

Copy link
Copy Markdown
Contributor

Summary

Adds an SDK wrapper for the ASX Corporate Actions endpoint GET /api/asx-corporate-actions.

Mirrors the paginated-endpoint pattern used for the Sanctions / Credit & Sovereign Risk / Interest Rates endpoints (bare query params, page[offset]/page[limit] pagination, JSON:API { data, meta, links } envelope).

Endpoint

GET /api/asx-corporate-actions — 1 API call per request.

Query params (bare, not filter[...]):

  • type — enum: dividends, splits, bonus-issues, rights-issues, buybacks, capital-returns, spp, other
  • symbol — ASX ticker with .AU suffix, e.g. PMV.AU
  • date_from / date_toYYYY-MM-DD
  • page[offset] (default 0), page[limit] (1-1000, default 100)

Changes

  • eodhd/APIs/ASXCorporateActionsAPI.py — new ASXCorporateActionsAPI with get_corporate_actions(); type-enum + pagination-bounds validation, URL-encoded bare params, blank/None params omitted.
  • eodhd/APIs/__init__.py — register the new API class.
  • eodhd/apiclient.pyAPIClient.get_asx_corporate_actions() facade delegating to the API class.
  • tests/test_asx_corporate_actions.py — 10 tests (URL/token/fmt, bare-params + no filter[], envelope keys, type lowercasing, hyphenated enum, invalid type, symbol URL-encoding, blank omission, pagination bounds, facade delegation).

Testing

python3 -m pytest tests/ — 80 passed (10 new). Envelope shape and endpoint live-verified.

Usage

from eodhd import APIClient

client = APIClient("YOUR_API_TOKEN")
resp = client.get_asx_corporate_actions(type="dividends", symbol="PMV.AU", page_limit=50)
data = resp["data"]

Add ASXCorporateActionsAPI wrapping GET /api/asx-corporate-actions
(JSON:API { data, meta, links } envelope, bare query params
type/symbol/date_from/date_to + page[offset]/page[limit] pagination).
Registered in eodhd/APIs/__init__.py and exposed via
APIClient.get_asx_corporate_actions(). Adds tests/test_asx_corporate_actions.py.
@alexpipipi

Copy link
Copy Markdown
Contributor Author

Bridge AI pre-merge review (Codex GPT-5.4 + Gemini Pro)

No genuine blockers. One flag on uri="" trailing-slash → live-verified HTTP 200 and matches the SDK-wide BaseAPI URL convention. Other notes (date-format validation, Enum class) intentionally left to match the mirrored thin-wrapper template (Sanctions/Credit-Risk from PR #74). pytest: 80 passed.

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