feat: add Credit & Sovereign Risk, Sanctions, Interest Rates APIs (14 endpoints) - #74
Merged
Merged
Conversation
Add three new API families covering 14 GET endpoints: - Credit & Sovereign Risk (/api/credit-risk): sovereign risk-premium, credit-ratings, cds-spreads, default-spreads; corporate cmdi, hqm-yields; cds-market aggregates - Sanctions (/api/sanctions): entities, vessels, programs, sources - Interest Rates (/api/rates, /api/spreads): reference-rates, policy-rates, funding-stress (no pagination) credit-risk and rates/spreads use filter[...] deep-object params; sanctions uses BARE query params (q=, program=, type=, active=, imo=, flag=, vessel_type=, source=, country=) per prometheus-web + live prod. Pagination is page[offset]/page[limit] throughout (except funding-stress: none). Filter/param values are URL-encoded via a shared helper so multi-word values do not corrupt the query string. Sanctions validates source->ofac and type/active enums. Registered in APIs/__init__.py, exposed via APIClient facade, covered by pytest.
… review) Reviewed against prometheus-web request classes and the Node SDK; fixed 4 server-verified discrepancies: - cds-market/aggregates: add filter[value] and filter[region] (server allows filter=array:metric,dimension,value,region,from,to; were missing) - hqm-yields: accept comma-separated type (server uses CsvIn(['spot','par']), so "spot,par" is valid) instead of rejecting it - reference-rates: stop hard-failing on non-USD/GBP/EUR currency; the server does not restrict currency (nullable|string|max:255), only uppercases it - sanctions/programs and sanctions/sources: drop page_offset/page_limit; these endpoints take no params and are not paginated server-side Updated tests accordingly (108 passed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s (PR #74) Multi-model review (Codex + opencode + aichat): all APPROVE_WITH_CHANGES. Applied the agreed items: - consolidate _filter/_param/_pagination into BaseAPI (were triplicated); omit blank/whitespace-only filter & bare values instead of emitting &filter[x]=/&x= - pagination: enforce server bound 1 <= page_limit <= 100 and reject bools / non-whole floats (int() no longer silently coerces True->1, 1.9->1) - HQM yields: rename shadowing `type` param to `yield_type` (serialised to filter[type], matching the entity_type pattern); a blank value is now omitted rather than raising - sanctions: normalise blank q/source/entity_type/active to "absent" before validation so they omit instead of raising - docs: fix stale facade currency docstring; clarify sanctions pagination applies to entities/vessels only - tests: add facade-level suite (test_apiclient_new_apis.py, parse_qs based) plus blank-omit / pagination-bound / bool-reject cases Declined (thin-client, documented): client-side enum validation for expandable sets (currency already relaxed, tenor grid, metric, dimension) and server-side business rules (date formats, string lengths) — left to the server. pytest: 122 passed. Smoke test (14 endpoints + review behaviours): 22 passed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
New API classes CreditSovereignRiskAPI / SanctionsAPI / InterestRatesAPI (14 methods) + facade + tests. pytest: 105 passed. Filter values URL-encoded.
Part of an updatelibs cross-repo sync adding 3 API families / 14 endpoints — Credit & Sovereign Risk (7), Sanctions/OFAC (4), Interest Rates (3) — across EODHD-openapi, Node SDK, Python SDK, Postman, and the Claude plugin. Sanctions uses bare query params (verified vs prometheus-web request classes + live prod); credit-risk & interest-rates use filter[...]. Bridge pre-push review (Codex + Gemini): no blockers.