Skip to content

Add fxmacrodata module - #1284

Merged
fdncred merged 3 commits into
nushell:mainfrom
fxmacrodata:fxmacrodata-module
Oct 5, 2026
Merged

fdncred merged 3 commits into
nushell:mainfrom
fxmacrodata:fxmacrodata-module

Conversation

@roberttidball

Copy link
Copy Markdown
Contributor

This adds a small fxmacrodata module that wraps the FXMacroData REST API (economic indicator releases, release calendars and FX spot rates) and returns plain Nushell tables.

use modules/fxmacrodata

fxmacrodata catalogue usd                          # indicators available for a currency
fxmacrodata history usd inflation --limit 12       # release history, most recent first
fxmacrodata calendar usd --indicator inflation     # upcoming scheduled releases
fxmacrodata forex eur usd --limit 30               # daily FX rates (needs a key)
  • Epoch and date fields are converted to datetime columns, so things like where release_time < ((date now) + 2wk) just work.
  • USD works without a key. If $env.FXMACRODATA_API_KEY is set it is sent as an X-API-Key header (never in the URL).
  • Free-tier notices from the API (90-day history window, 15 minute release delay) are printed to stderr so they don't end up in the table.
  • Every command takes --raw to get the untouched JSON response.

Checked with nu-check --as-module on nu 0.116.1, and ran each command against the live API.

@roberttidball

Copy link
Copy Markdown
Contributor Author

Small hardening pass: requests no longer follow redirects, so the API key is never re-sent to another host, the key is trimmed before use, and a 200 response with an error body or an unexpected shape now raises a clear error instead of a missing-column failure. (not run locally)

@fdncred
fdncred merged commit 4033ddf into nushell:main Oct 5, 2026
1 check passed
@fdncred

fdncred commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Thanks

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.

2 participants