Plugins

Extend Hayashi without changing the core. Three tiers: native Rust, WebAssembly, and Hayashi scripts.

How plugins work

Plugins are installed from GitHub, loaded automatically, and exposed through a single namespace.

Native Rust

Maximum performance and full access to the Hayashi ABI. Compiled as .so, .dylib, or .dll for each release target.

WebAssembly

Sandboxed, portable, and safe. One binary runs on every platform. Ideal for untrusted or third-party code.

Hayashi scripts

Pure Hayashi code shared as a repository. No compilation required. Good for estimators, transformations, and reusable workflows.

Install a plugin

terminal
hay install user/repo

# Update one or all plugins
hay update user/repo
hay update

# Remove
hay remove user/repo

Use a plugin

plugin.hay
import("user/myplugin", as=mp)

let m = ols(lwage ~ educ + exper, df)
let fitted = predict(m, df)

let result = mp::transform(fitted)
print(result)

Approved plugins

Officially endorsed plugins maintained by the Hayashi team. They are grouped by what they do. Some are mature; others are young experiments. All are open source.

Data sources

Plug Hayashi into external databases, APIs, and curated datasets.

5 plugins

haywooldridge

NATIVE Data source

Native Wooldridge datasets plugin for Hayashi. Brings the textbook datasets directly into DataFrames for teaching and replication.

$ hay install sheep-farm/haywooldridge

hayfred

NATIVE Data source

FRED (Federal Reserve Economic Data) connector. Fetch GDP, CPI, unemployment, interest rates, and 800+ other US economic time series directly into Hayashi DataFrames.

fetch search categories releases
$ hay install sheep-farm/hayfred
v0.1.0 GitHub →

haybrasil

NATIVE Data source

Brazilian macroeconomic data plugin with real API integration. Access BCB (Selic, PIB, reserves), IBGE (municipal GDP, IPCA, unemployment), and CVM (company data, financial statements, FIIs) directly from official Brazilian government APIs.

bcb_selic bcb_pib ibge_inflacao_ipc_a12 cvm_empresas_cia_aberta
$ hay install sheep-farm/haybrasil
v0.2.0 GitHub →

haygeobr

NATIVE Data source

Official Brazilian spatial data from IPEA's geobr project. Download states, municipalities, biomes, regions, census tracts, indigenous lands, conservation units, and more as DataFrames with WKT geometry. 28 datasets available with automatic caching.

read_state read_municipality read_biomes read_country read_census_tract list_datasets
$ hay install sheep-farm/haygeobr
v0.1.6 GitHub →

hayahoo

NATIVE Data source

Yahoo Finance market data connector. Historical OHLCV prices, real-time quotes, ticker search, and instrument metadata. Caches responses and handles rate limits gracefully.

quote history search info
$ hay install sheep-farm/hayahoo
v0.1.1 GitHub →

Visualization & output

Turn results into plots, maps, documents, and exportable formats.

4 plugins

hayplot

NATIVE Visualization

Plotting and visualization with SVG and PNG output. Scatter, line, bar, histogram, box, and area plots. Multi-series support with configurable axes, legends, and themes. Uses Arrow FFI for zero-copy data transfer.

scatter line bar histogram box area
$ hay install sheep-farm/hayplot
v1.4.0 GitHub →

haytex

NATIVE Output

Export Hayashi estimation results and DataFrames to publication-ready LaTeX. Supports regression tables, summary statistics, and tabular data with customizable formatting, column alignment, and booktabs-style rules.

regression summary table
$ hay install sheep-farm/haytex
v0.2.2 GitHub →

haygeom

NATIVE Visualization

Geographic mapping plugin for Hayashi. Create maps with multiple layers, automatic projection, and SVG output. Supports WKT geometries (POINT, POLYGON, MULTIPOLYGON) and integrates with haygeobr for Brazilian spatial data.

map add_layer render
$ hay install sheep-farm/haygeom
v0.1.2 GitHub →

hayexport

NATIVE Output

Export utilities for Hayashi. Convert DataFrames and estimation results into common formats for interoperability with other tools.

$ hay install sheep-farm/hayexport

Modeling & estimation

Estimators, samplers, optimizers, and simulation tools.

4 plugins

haybayes

NATIVE Estimation

Bayesian econometrics for Hayashi. Metropolis-Hastings and Gibbs samplers, conjugate priors, Bayesian regression, credible intervals, posterior predictive distributions, and model comparison via Bayes factors.

metropolis_hastings gibbs_sampler bayesian_regression credible_interval model_comparison
$ hay install sheep-farm/haybayes
v0.1.2 GitHub →

haysim

NATIVE Simulation

Simulation utilities for Hayashi. Generate synthetic datasets and Monte Carlo experiments for teaching and validation.

$ hay install sheep-farm/haysim

hayopt

NATIVE Optimization

Optimization routines for Hayashi. Numerical solvers for maximum likelihood, minimum distance, and general objective functions.

$ hay install sheep-farm/hayopt

haytime

NATIVE Time series

Time series utilities for Hayashi. Date indexing, lag/lead operations, rolling windows, and frequency handling.

$ hay install sheep-farm/haytime

Utilities & integration

Glue code, spatial helpers, and connectors that do not fit the categories above.

2 plugins

hayweb

NATIVE Utility

Web integration utilities for Hayashi. Helpers for HTTP requests, web scraping, and API clients.

$ hay install sheep-farm/hayweb

hayspatial

NATIVE Utility

Spatial analysis helpers for Hayashi. Coordinate transformations, spatial joins, and geometry operations.

$ hay install sheep-farm/hayspatial

Want your plugin listed here? Open an issue on the Hayashi repo with a link to your plugin, a brief description, and the category it fits. Approved plugins must be open source, cross-platform, and pass a code review.

Create a plugin

The fastest way to build a new plugin is to imitate existing ones. The code is the documentation.

workflow
0) clone hayashi and hayashi-plugin-sdk
1) find 1-3 plugins that resemble what you want
2) ask your preferred AI to study the code
3) ask it to build your plugin

Native plugins are GitHub repositories that expose functions through the Hayashi ABI. The package manager downloads the correct release asset for the user's platform. For a full SDK reference, see the books.