JCGEImportData API

Core data structures and transformations

JCGEImportData.IOBundle — Method
IOBundle(; goods, activities, factors, institutions, tax_accounts, ext_accounts,
         use, supply, value_added, final_demand, taxes=nothing, imports=nothing,
         exports=nothing, factor_income=nothing)

Create an IO bundle with label validation across tables.

source
JCGEImportData.MultiRegionIOT — Type
MultiRegionIOT

Source-neutral sparse, multi-region, industry-by-industry IO representation. sales_structure records the Model-D allocation of each product to its producing industries; intermediate and final_demand record the resulting industry sales. For a source table that is already industry-by-industry, products and sales_structure are empty. It does not impose factor, institution, tax, or closure accounts.

source
JCGEImportData.MultiRegionIOT — Method
MultiRegionIOT(; regions, products, industries, final_uses,
               sales_structure, intermediate, final_demand, industry_output,
               provenance=Dict())

Create and validate a normalized multi-region industry-by-industry IO table.

source
JCGEImportData.MultiRegionSUT — Type
MultiRegionSUT

Source-neutral representation of a multi-region supply-use table. supply contains product_origin, product, activity_region, activity, and value; use contains product_origin, product, use_region, use_account, and value.

This represents data only. It does not choose a symmetric IO transformation, regional aggregation, institutional closure, or model specification.

source
JCGEImportData.MultiRegionSUT — Method
MultiRegionSUT(; regions, products, activities, final_uses, supply, use,
               source_tables=Dict(), provenance=Dict())

Create a normalized multi-region SUT and validate its required columns and account labels.

source
JCGEImportData.SatelliteTable — Type
SatelliteTable(; regions, industries, indicators, data, provenance=Dict())

Source-neutral satellite observations keyed by region, industry, and indicator. Each observation carries its source unit, so physical, environmental, and socioeconomic quantities remain separate from monetary IO tables.

source
JCGEImportData._add_block! — Method
_add_block!(sam, index, mat; row_accounts=nothing, col_accounts=nothing, transpose=false)

Internal: add a labeled matrix into the SAM by account index.

source
JCGEImportData._all_accounts — Method
_all_accounts(goods, activities, factors, institutions, tax_accounts, ext_accounts)

Internal: build the ordered list of SAM accounts.

source
JCGEImportData._apply_factor_income! — Method
_apply_factor_income!(sam, index, bundle)

Internal: inject factor income flows into the SAM, using a default institution when explicit factor income is not provided.

source
JCGEImportData.check_sut_balance — Method
check_sut_balance(sut; atol=1e-6)

Report global supply and use totals for each product in a MultiRegionSUT. The check is descriptive: it does not alter the source data.

source
JCGEImportData.write_canonical_dataset — Method
write_canonical_dataset(dir, bundle; sam=nothing, sets=nothing, subsets=nothing,
                         labels=nothing, mappings=nothing, params=nothing)

Write the canonical CSV dataset to dir.

source
JCGEImportData.Transformations.check_iot_balance — Method
check_iot_balance(iot; atol=1e-6)

Report the applicable sales-share sums and the difference between each industry's recorded output and its intermediate plus final sales. Sales-share diagnostics apply only to IO tables constructed from an SUT; direct industry-by-industry imports have no product sales structure. A non-zero industry difference reflects an imbalance already present in source data; this function does not alter the IO data.

source
JCGEImportData.Transformations.symmetric_io_model_d — Method
symmetric_io_model_d(sut; atol=1e-12)

Construct a sparse, multi-region, industry-by-industry IO representation from sut using the fixed-product sales structure convention known as Eurostat Model D. For every product origin, each use is allocated to producing industries according to their recorded shares of that product's supply.

Only product rows are transformed. Non-product source rows, such as factor and tax entries, remain available in sut.source_tables for an explicit later mapping by the consuming model.

source

BEA

JCGEImportData.Adapters.BEAFlatSchema — Type
BEAFlatSchema(; ...)

Column mapping for long-form U.S. Bureau of Economic Analysis (BEA) Make and Use table exports. The Make table must contain commodity, producing-industry, and value columns; the Use table must contain commodity, using-account, and value columns. The source's valuation and adjustment treatment are recorded by BEAAdapter rather than changed by the importer.

source
JCGEImportData.Adapters.BEAAdapter — Type
BEAAdapter(make_path, use_path; products, activities, final_uses, region,
           valuation, schema=BEAFlatSchema(), year=nothing)

Read local long-form BEA Make and Use exports as a single-region SUT. products and activities are explicit so the importer does not infer published totals or adjustment rows. final_uses identifies the retained final-demand accounts. valuation records the selected BEA table basis; the adapter does not reconcile purchaser prices, producer prices, imports, trade margins, or taxes.

source
JCGEImportData.Adapters.BEARelease — Type
BEARelease(reference_year, make_table_id, use_table_id)

Explicit selection of published BEA InputOutput Make and Use tables for one year. Table identifiers are supplied by the caller because BEA publishes multiple table families with distinct accounting conventions.

source
JCGEImportData.Adapters.download_bea — Function
download_bea(release, directory; api_key)

Download the explicitly selected BEA InputOutput Make and Use tables through the official BEA API. The API key is required, is validated before use, and is never written to the cache manifest. The cache retains the raw API responses, long-form CSV files compatible with BEAAdapter, and checksums for both.

source
JCGEImportData.Adapters.BEANationalAccountsRelease — Type
BEANationalAccountsRelease(reference_year, table_name; frequency="A", region="US")

An explicit selection of one published BEA National Income and Product Accounts (NIPA) table. table_name is retained exactly as published by BEA; the importer does not select a table or infer a SAM account mapping.

source
JCGEImportData.Adapters.download_bea_national_accounts — Function
download_bea_national_accounts(release, directory; api_key, lines, metrics)

Download one explicitly selected BEA NIPA table through the official BEA API. lines and metrics are published source codes and labels selected by the caller. The normalized records preserve BEA line, series, description, metric, unit, and unit multiplier fields for a later model-specific SAM mapping.

source

Eurostat

JCGEImportData.Adapters.EurostatAdapter — Type
EurostatAdapter(supply_path, use_path; schema=FIGAROFlatSchema(), year=nothing)

Read Eurostat FIGARO flat supply and use files. The files remain local inputs; the adapter neither downloads a particular FIGARO edition nor imposes a region aggregation or an IO transformation.

source
JCGEImportData.TableAdapters.EurostatNationalSUTRelease — Type
EurostatNationalSUTRelease(reference_year, region; ...)

Description of the published Eurostat national supply and use tables selected for one country and year. Defaults identify Eurostat's current-price supply table (naio_10_cp15) and annual use table at purchasers' prices (naio_10_cp16); callers can replace both identifiers explicitly when another published table pair is intended.

source
JCGEImportData.TableAdapters.download_eurostat_national_sut — Function
download_eurostat_national_sut(release, directory; products, activities, final_uses)

Download the caller-selected official Eurostat national supply and use tables once, retain raw JSON-stat responses, and write local long-form supply/use CSV files for EurostatNationalSUTAdapter. Product, industry, and final-use codes are explicit. The function filters stk_flow to TOTAL where that dimension is present; valuation and any subsequent balancing remain model decisions.

source
JCGEImportData.TableAdapters.EurostatNationalSUTAdapter — Type
EurostatNationalSUTAdapter(supply_path, use_path; ...)

Read a local long-form export of Eurostat national supply and use data. The caller chooses the source valuation and treatment of imports, margins, and taxes before import; this adapter only normalizes that selection.

source
JCGEImportData.TableAdapters.EurostatNationalAccountsRelease — Type
EurostatNationalAccountsRelease(reference_year, dataset; unit, dimensions,
                                region_dimension="geo", filters=Dict("freq" => "A"))

Description of one selected Eurostat national-accounts dataflow. dimensions are the published dimensions that the calling workflow will select explicitly, for example ("sector", "na_item", "direct") for annual institutional-sector transactions. The resulting local table preserves these source dimensions; it does not map them to SAM accounts.

source
JCGEImportData.TableAdapters.download_eurostat_national_accounts — Function
download_eurostat_national_accounts(release, directory; regions, selections)

Download one explicitly selected Eurostat national-accounts table through the official dissemination API. selections must specify every dimension declared by release. The returned CSV has region, the declared source-dimension columns, unit, and value; it is a source cache for a later explicit SAM mapping, not a SAM construction routine.

source
JCGEImportData.TableAdapters.SatelliteAdapter — Type
SatelliteAdapter(path; regions, industries, indicators, source, ...)

Read a unit-preserving local satellite table. It keeps physical, environmental, and socioeconomic observations outside monetary IO accounts.

source
JCGEImportData.TableAdapters.EurostatSatelliteRelease — Type
EurostatSatelliteRelease(reference_year, dataset; ...)

Explicit description of a Eurostat dataset that can be normalized into the unit-preserving SatelliteAdapter layout. The caller specifies the source dimensions that identify regions, industries, and indicators. Set industry_dimension = nothing for an economy-wide source and provide an explicit aggregate_industry when downloading it.

source
JCGEImportData.TableAdapters.download_eurostat_satellite — Function
download_eurostat_satellite(release, directory; regions, industries, indicators,
                            aggregate_industry=nothing)

Download an explicitly selected Eurostat satellite source and normalize it to region, industry, indicator, unit, value records. It keeps raw JSON-stat responses and a checksum manifest. For an industry-resolved source, provide industries; for an economy-wide source, set release.industry_dimension = nothing and explicitly supply the account label to use as aggregate_industry.

source

FIGARO

JCGEImportData.Adapters.FIGAROFlatSchema — Type
FIGAROFlatSchema(; ...)

Column mapping for Eurostat FIGARO flat supply and use files. The defaults match the compact five-column export used by the FACT national IO tables service. For a direct Eurostat flat CSV export, pass its column names and delimiter explicitly.

source
JCGEImportData.Adapters.FIGARORelease — Type
FIGARORelease(reference_year; supply_dataset=nothing, use_dataset=nothing,
              unit="MIO_EUR")

Description of one Eurostat FIGARO release. The importer uses Eurostat's official dissemination API and writes a local, normalized cache. For 2014–17, the matching FIGARO dataflows are selected automatically. For other periods, callers must give both official dataset identifiers explicitly.

source
JCGEImportData.Adapters.download_figaro — Function
download_figaro(release, directory; regions)

Download one selected regional FIGARO subsystem from Eurostat's official SDMX API. regions is explicit: this function neither chooses a model geography nor downloads data during model loading. It writes normalized supply and use TSV files compatible with EurostatAdapter, plus a manifest recording every API query and file checksum. Existing caches are never overwritten.

Only transactions whose origin and destination are both in regions are retrieved. Transactions with other FIGARO regions remain available to a model-specific preparation workflow through a separately chosen source scope.

source

OECD ICIO

JCGEImportData.TableAdapters.IOTAdapter — Type
IOTAdapter(intermediate_path, final_demand_path, output_path; ...)

Read local long-form intermediate, final-demand, and gross-output tables for a symmetric industry-by-industry IO system. The caller explicitly supplies the retained regions, industries, final-use accounts, valuation, and source.

source
JCGEImportData.TableAdapters.OECDICIOAdapter — Type
OECDICIOAdapter(intermediate_path, final_demand_path, output_path; edition, ...)

Read a local long-form extraction of OECD Inter-Country Input-Output (ICIO) tables using the generic IO layout. The source edition and extraction scope are always explicit; this adapter does not download or aggregate ICIO data.

source
JCGEImportData.TableAdapters.OECDICIORelease — Type
OECDICIORelease(edition, period, archive_url)

Description of one caller-selected official OECD ICIO archive. OECD publishes ICIO as period archives, so the URL and its edition are explicit rather than embedded in package code.

source
JCGEImportData.TableAdapters.download_oecd_icio — Function
download_oecd_icio(release, directory)

Cache a caller-selected official OECD ICIO archive and record its URL, edition, period, retrieval time, and checksum. It does not select countries or convert the source matrix; use OECDICIOAdapter after an explicit local extraction.

source
JCGEImportData.TableAdapters.normalize_oecd_icio — Function
normalize_oecd_icio(release, archive_path, directory; reference_year, regions,
                    industries, final_uses)

Read one year from a regular OECD ICIO CSV archive and write the selected intermediate, final-demand, and gross-output tables in the local long-form IO layout accepted by OECDICIOAdapter. Regions, industries, and final-demand categories are source codes and must be selected explicitly. The function preserves the source's industry-by-industry structure; aggregation, treatment of value added, and SAM construction remain outside this importer.

source

Local-table loaders

JCGEImportData.Adapters.load_iobundle — Function
load_iobundle(adapter::EurostatAdapter)

FIGARO is inherently a multi-region SUT. Use load_sut first, then choose the model-specific region aggregation and SUT-to-IO transformation explicitly.

source
JCGEImportData.Adapters.load_sut — Function
load_sut(adapter::EurostatAdapter; drop_zeros=true)

Load a multi-region FIGARO SUT. A DOM origin in a use table is resolved to the corresponding use region. Product rows are identified by the configured product_prefix; all remaining use accounts are retained and classified from the supply activity list rather than hard-coded.

source
JCGEImportData.TableAdapters.load_iot — Function
load_iot(adapter; drop_zeros=true)

Load a direct industry-by-industry IO table. It retains no product sales structure because one is neither observed nor needed for a direct IO source.

source