narwhalapi 0.2.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- narwhalapi-0.4.0/CHANGELOG.md +155 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/PKG-INFO +10 -1
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/README.md +9 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/pyproject.toml +1 -1
- narwhalapi-0.4.0/src/narwhalapi/_generated/__init__.py +3 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_generated/models.py +1010 -715
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_generated/operations.py +682 -696
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_transport.py +6 -1
- narwhalapi-0.4.0/src/narwhalapi/_version.py +1 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/codes.py +9 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/models.py +74 -66
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/webhooks.py +20 -3
- narwhalapi-0.2.0/CHANGELOG.md +0 -24
- narwhalapi-0.2.0/src/narwhalapi/_generated/__init__.py +0 -3
- narwhalapi-0.2.0/src/narwhalapi/_version.py +0 -1
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/LICENSE +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/hatch_build.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/__init__.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_client.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_deadline.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_decode.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_meta.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/_pagination.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/errors.py +0 -0
- {narwhalapi-0.2.0 → narwhalapi-0.4.0}/src/narwhalapi/py.typed +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.4.0 — 2026-10-22
|
|
4
|
+
|
|
5
|
+
Breaking: 0.3.x fails on calls changed by the API contracts of 21-22 October 2026.
|
|
6
|
+
Upgrade to 0.4.0 for these calls. 0.4.0 fails against gateways using the old response
|
|
7
|
+
formats. Fields the API omits when empty are now optional (`None`). Lists are always present.
|
|
8
|
+
|
|
9
|
+
- Trade: the four separate export and import methods are removed (`economics.trade_exports`,
|
|
10
|
+
`trade_exports_history`, `trade_imports`, `trade_imports_history`). Their routes no longer
|
|
11
|
+
exist. `economics.trade` and `economics.trade_history` return exports and imports in one
|
|
12
|
+
row. The models `TradeExports`, `TradeImports` and `TradeProductFilter` are removed, and
|
|
13
|
+
`TradeSummary` has no `coverage`.
|
|
14
|
+
Migrate: call the combined methods and read `exports` and `imports` from the row.
|
|
15
|
+
- Economics series: `Cpi` has an `index_base` string instead of `base_period` and
|
|
16
|
+
`base_value`. `Inflation`, `Unemployment` and `LabourForceParticipation` have no `unit`.
|
|
17
|
+
`SeriesSource` has no `released_on_basis`.
|
|
18
|
+
Migrate: read `index_base`; drop reads of `unit`.
|
|
19
|
+
- GDP: `Gdp` drops `seasonal_adjustment`, `annualization` and `price_basis`. `GdpGrowth` drops
|
|
20
|
+
`seasonal_adjustment`, `quarter_over_quarter_seasonal_adjustment`,
|
|
21
|
+
`year_over_year_seasonal_adjustment`, `annualization`, `price_basis` and `unit`. The
|
|
22
|
+
optional flags `annualized` and `not_seasonally_adjusted` (and, on growth,
|
|
23
|
+
`quarter_over_quarter_not_seasonally_adjusted` and `year_over_year_not_seasonally_adjusted`)
|
|
24
|
+
are present only when true.
|
|
25
|
+
Migrate: treat a missing flag as false.
|
|
26
|
+
- Economics history: `HistoricalEconomicsResponse` and `HistoricalObservation` are removed.
|
|
27
|
+
Each indicator has its own response type (`CpiHistory`, `GdpHistory`, `GdpGrowthHistory`,
|
|
28
|
+
`InflationHistory`, `RateHistory`, `TradeHistory`) with matching `...Observation` rows.
|
|
29
|
+
Rows contain only `period` and `value` (trade rows hold `exports` and `imports`).
|
|
30
|
+
Migrate: use the new response and observation types.
|
|
31
|
+
- Economic calendar: `EconomicRelease` is replaced by `EconomicReleaseSummary` (lists) and
|
|
32
|
+
`EconomicReleaseDetail` (`economics.get_release`). `indicators` is now `values`
|
|
33
|
+
(`EconomicReleaseValue`). The `EconomicReleaseIndicator` and `EconomicReleaseSchedule`
|
|
34
|
+
models are removed. The schedule now uses the flat fields `at`, `date`, `between` and `by`.
|
|
35
|
+
`reference_period` is renamed to `period`. `title`, `variant` and `officially_published_at`
|
|
36
|
+
are removed. `EconomicCalendar` has no `as_of`, `snapshot` or `status`. `between` is a list
|
|
37
|
+
of two dates.
|
|
38
|
+
Migrate: read the flat schedule fields and `values`.
|
|
39
|
+
- Holidays: `CalendarHolidays.year`, `CalendarHolidaysOnDate.date`,
|
|
40
|
+
`CalendarNextHoliday.from_date`, `nationwide` (on coverage and holidays) and
|
|
41
|
+
`TopicCalendar.variant` are removed.
|
|
42
|
+
Migrate: use the values from your request.
|
|
43
|
+
- FX and commodities: `FxConversion` has no `amount`. `FxHistory` has no `has_more`; its
|
|
44
|
+
`start_date` and `end_date` are optional. `FxBars` and `CommodityBars` have no `interval`,
|
|
45
|
+
and `start` and `end` appear only when the range was clipped. `Quote.role` is removed.
|
|
46
|
+
`PhysicalSeries` has `country` and no `market` or `publisher`; its list call has no `market`
|
|
47
|
+
parameter. `attribution` is now required on `PhysicalSeries`, `PhysicalLatest` and
|
|
48
|
+
`PhysicalObservations`.
|
|
49
|
+
Migrate: use the amount you sent; filter series by country.
|
|
50
|
+
- Palm oil: `PalmoilScalarSeries.commodity`, `PalmoilScheduleSeries.commodity` and
|
|
51
|
+
`PalmoilScheduleSeries.producer_type` are removed.
|
|
52
|
+
Migrate: remove reads of these fields.
|
|
53
|
+
- Prediction event fields: events no longer have `body`, `quality` or `shape`. The models
|
|
54
|
+
`BinaryBody`, `ScalarBody`, `ExtremeBody`, `TimingBody`, `PredictionQuality`,
|
|
55
|
+
`PredictionResolution`, `ScalarSummary` and `ScalarSummaryBounds` are removed. Each event
|
|
56
|
+
type carries its own fields: binary `probability`, `quotes`, `labels`; scalar `median`,
|
|
57
|
+
`p10`, `p90`, `above`, `outcomes`; extreme `up`, `down`, `observation`, `window`; timing
|
|
58
|
+
`steps`, `not_within_window`. All have `resolves_with` and `stale`. `resolution` is now a
|
|
59
|
+
plain string instead of an object with `description` and `resolves_with`.
|
|
60
|
+
Migrate: read event fields directly; use `resolves_with` for `resolution.resolves_with`.
|
|
61
|
+
- Prediction venues, lists and history: `PredictionVenue` has no `role`, `venue_event_id`,
|
|
62
|
+
`depth_usd` or `fetched_at`. `settlement` is now an optional string instead of an object
|
|
63
|
+
with `status`. The `VenueSettlement` model is removed. `match` is optional.
|
|
64
|
+
`PredictionEventSummary` has no `as_of`. `PredictionTopicDetail.events` is a list of the new
|
|
65
|
+
`PredictionTopicEvent` (no `topic_id` or `shape`). `next_event_id` is removed.
|
|
66
|
+
`PredictionHistory` has no `event_id`, `shape`, `interval`, `start` or `captured_from`, and
|
|
67
|
+
`end` is optional. `PredictionBar` has `timestamp` instead of `start` and `end`.
|
|
68
|
+
`PolicyPath` and `PolicyPathHistory` have no `authority`, `method` or `unit`; the history
|
|
69
|
+
has `meeting_dates` (`PolicyPathMeetingDate`), and `PolicyPathDay.meetings` is a list of the
|
|
70
|
+
new `PolicyPathOdds` (no `resolves_at`). `PredictionWebhookEvent.event_id` is
|
|
71
|
+
`prediction_event_id`.
|
|
72
|
+
Migrate: use the new types and read the settlement string directly.
|
|
73
|
+
- Prediction results: events and event summaries now include `result` (`PredictionResult`)
|
|
74
|
+
with `final`, `settled_at`, `amended_at` and the settled `markets` for each venue.
|
|
75
|
+
`unavailable` is sent for each venue only when true.
|
|
76
|
+
Migrate: read results from events or event summaries.
|
|
77
|
+
- Events and webhooks: `EventDetail` is now the event itself, with no `event` wrapper or
|
|
78
|
+
`status`. `EventsPage` has no `status`. `DeliveryEvent` has no `event_type`,
|
|
79
|
+
`schema_version`, `publication_id` or `holiday_country`. `WebhookEvent` has no `is_test`,
|
|
80
|
+
`publication_id` or `holiday_country`. Test deliveries use the event type `webhook.test`.
|
|
81
|
+
The webhook verifier accepts both new bodies with null fields omitted and old bodies. For
|
|
82
|
+
old prediction bodies whose market is named `event_id`, it fills `prediction_event_id`.
|
|
83
|
+
Migrate: read event fields directly; check `type` instead of `is_test`.
|
|
84
|
+
- Webhook records: `WebhookConfigurationHistory` renames `version` to `config_version` and
|
|
85
|
+
removes `destination_id` and `activation_snapshot`. `WebhookDestinationList.limit` is renamed
|
|
86
|
+
to `destination_limit`. `WebhookDeliveriesResponse` has no `limit`.
|
|
87
|
+
`WebhookDelivery.next_attempt_at`, `retry_until` and `replays` are optional.
|
|
88
|
+
`WebhookTestResponse` has no `destination_id`. `CalendarSubscriptionCreated` has no
|
|
89
|
+
`refresh_note`.
|
|
90
|
+
Migrate: rename the fields; handle missing values.
|
|
91
|
+
- No-content responses: `webhooks.delete_destination`, `webhooks.replay_delivery` and
|
|
92
|
+
`calendar_subscriptions.revoke` respond with `204` and return an empty `NoContent` object.
|
|
93
|
+
The models `WebhookDeleteResponse`, `WebhookReplayResponse` and
|
|
94
|
+
`CalendarSubscriptionRevoked` are removed.
|
|
95
|
+
Migrate: stop reading `deleted`, `replayed` and `revoked`; success means no error.
|
|
96
|
+
- Errors: `Problem` has no `instance` or `ok`.
|
|
97
|
+
Migrate: remove reads of these fields.
|
|
98
|
+
- Calendar `view`: the SDK no longer offers or sends this parameter. The API ignores it. Lists
|
|
99
|
+
always contain the full release.
|
|
100
|
+
Migrate: no changes needed.
|
|
101
|
+
- Enums removed with their fields: `Annualization`, `CentralBank`,
|
|
102
|
+
`GrowthSeasonalAdjustment`, `IndicatorValueStatus`, `PredictionInterval`, `QuoteFreshness`,
|
|
103
|
+
`QuoteRole`, `SchedulePrecision`, `ScheduleTimeBasis`, `SeasonalAdjustment`, `ValueScale`,
|
|
104
|
+
`ValueTransformation`. New: `EconomicReleaseValueValueStatus`, `PredictionVenueSettlement`,
|
|
105
|
+
`ScalarEventAbove`.
|
|
106
|
+
Migrate: remove references to the removed enums.
|
|
107
|
+
- README lists the product's key pages as full URLs.
|
|
108
|
+
|
|
109
|
+
## 0.3.0 — 2026-10-18
|
|
110
|
+
|
|
111
|
+
- Breaking: `webhooks.verify` now returns a `WebhookEvent`, read from the delivery bodies the
|
|
112
|
+
API documents. 0.2.0 read deliveries as the REST `DeliveryEvent`, which needs an `event_type`
|
|
113
|
+
field that webhook bodies never carry, so it rejected real deliveries with `invalid_body`.
|
|
114
|
+
`WebhookEvent` reads economics, release calendar and holiday events, prediction events
|
|
115
|
+
(`prediction`, with the event status and venue settlements) and test deliveries (`is_test`,
|
|
116
|
+
no `cursor`). Unknown event types still decode, with the type kept as a string.
|
|
117
|
+
- `economics.read_series_observations(series_id, ...)` reads the observations of one economic
|
|
118
|
+
series by its id, with a page iterator (`read_series_observations_iter`).
|
|
119
|
+
- Prediction history (`binary_history`, `scalar_history`, `extreme_history`, `timing_history`)
|
|
120
|
+
now comes in pages of about 5,000 bars with a `next_cursor`. Pass `cursor`, or use the new
|
|
121
|
+
`…_iter` iterators, to read a whole window; each page repeats the series keys with the next
|
|
122
|
+
slice of bars. The API pages these responses for every version, so 0.2.0 sees only the first
|
|
123
|
+
page of a wide window.
|
|
124
|
+
- Webhook destinations carry `disabled_reason`: `customer` (switched off by the account),
|
|
125
|
+
`plan_limit` (paused because the plan no longer includes it) or none.
|
|
126
|
+
- New code constants for the documented errors: `SNAPSHOT_UNAVAILABLE`, `REQUEST_TOO_LARGE`,
|
|
127
|
+
`RIGHTS_STATE_CHANGING`, `COMMAND_UNAVAILABLE`, `PHYSICAL_SERIES_NOT_FOUND`,
|
|
128
|
+
`PHYSICAL_REFERENCE_UNAVAILABLE`, `EVENT_NOT_FOUND`, `PREDICTIONS_UNAVAILABLE` and
|
|
129
|
+
`LIMIT_REACHED`.
|
|
130
|
+
- No change on the wire: the contract now names the palm oil price unions and the shared
|
|
131
|
+
problem response, and documents `400` instead of `422` for webhook and calendar subscription
|
|
132
|
+
validation errors, which is what the API always returned.
|
|
133
|
+
|
|
134
|
+
## 0.2.0 — 2026-10-12
|
|
135
|
+
|
|
136
|
+
- Breaking: economic calendar releases now carry Narwhal's English `name`, a permanent
|
|
137
|
+
`series_id`, a `topic` and a `stage` beside the publisher's `title`, and each schedule
|
|
138
|
+
carries its `local_date`. The API lists releases compactly by default; the SDK always asks
|
|
139
|
+
for the full release (`view=full`), so every field stays typed. Research articles are no
|
|
140
|
+
longer listed.
|
|
141
|
+
- `CALENDAR_NOT_PUBLISHED` for the 404 returned when a holiday calendar year is not published.
|
|
142
|
+
- FX bars publish their five fields again in the contract (no wire change).
|
|
143
|
+
|
|
144
|
+
## 0.1.0 — 2026-10-09
|
|
145
|
+
|
|
146
|
+
- Initial typed synchronous and asynchronous clients for the stable API: economics,
|
|
147
|
+
FX, calendars, physical palm oil, spot prices (`commodities.spot_price`), events,
|
|
148
|
+
webhook destinations and calendar subscriptions.
|
|
149
|
+
- `nw.unstable` holds operations not yet in the live API; it is empty in this release.
|
|
150
|
+
- Exact decimals, typed errors, bounded retries, page iterators, response metadata,
|
|
151
|
+
and local webhook signature verification.
|
|
152
|
+
- `codes.PLAN_UPGRADE_REQUIRED` for the 403 returned when a request reaches before the
|
|
153
|
+
plan's history window.
|
|
154
|
+
- The release also covers prediction market reads, FX and commodity bar history, and physical commodity reference price series.
|
|
155
|
+
- Spot `bid` and `ask` are optional because the API may omit them.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: narwhalapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Typed clients for the Narwhal API
|
|
5
5
|
Project-URL: Homepage, https://narwhalapi.com
|
|
6
6
|
Author-email: Narwhal API Team <support@narwhalapi.com>
|
|
@@ -155,3 +155,12 @@ event = verify(raw_body, request.headers, webhook_secret)
|
|
|
155
155
|
|
|
156
156
|
Do not parse and re-serialize the body before verification. A verification failure raises
|
|
157
157
|
`errors.WebhookVerificationError` with a `reason`. Neither framework is a package dependency.
|
|
158
|
+
|
|
159
|
+
## Links
|
|
160
|
+
|
|
161
|
+
- https://narwhalapi.com/
|
|
162
|
+
- https://narwhalapi.com/docs
|
|
163
|
+
- https://narwhalapi.com/pricing
|
|
164
|
+
- https://narwhalapi.com/compare/economic-data-apis
|
|
165
|
+
- https://narwhalapi.com/commodities/gold
|
|
166
|
+
- https://narwhalapi.com/economics/united-states
|
|
@@ -130,3 +130,12 @@ event = verify(raw_body, request.headers, webhook_secret)
|
|
|
130
130
|
|
|
131
131
|
Do not parse and re-serialize the body before verification. A verification failure raises
|
|
132
132
|
`errors.WebhookVerificationError` with a `reason`. Neither framework is a package dependency.
|
|
133
|
+
|
|
134
|
+
## Links
|
|
135
|
+
|
|
136
|
+
- https://narwhalapi.com/
|
|
137
|
+
- https://narwhalapi.com/docs
|
|
138
|
+
- https://narwhalapi.com/pricing
|
|
139
|
+
- https://narwhalapi.com/compare/economic-data-apis
|
|
140
|
+
- https://narwhalapi.com/commodities/gold
|
|
141
|
+
- https://narwhalapi.com/economics/united-states
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Generated from spec/live/openapi.json sha256 ba06d620d3f1f03774f3f30363a59e00f14ab7cde053c552d2164ad83a9ea678. Do not edit.
|
|
2
|
+
# Generated from spec/next/openapi.json sha256 ba06d620d3f1f03774f3f30363a59e00f14ab7cde053c552d2164ad83a9ea678. Do not edit.
|
|
3
|
+
"""Generated contract surface."""
|