Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
18 changes: 18 additions & 0 deletions db/data/ici/fact_book_table_30/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
source_id: ici
package_id: ici-fact-book-table-30
dataset: ici_fact_book_table_30
source_page: https://www.icifactbook.org/26-fb-data-tables.html
table: 2026 Investment Company Fact Book Data Table 30, Long-Term Mutual Funds Paid and Reinvested Capital Gains by Type of Fund
files:
2026:
filename: 26-fb-table-30.xlsx
source_url: https://www.icifactbook.org/xls/26-fb-table-30.xlsx
sha256: bd15d5fc983e55632bbe3f884f9c826f6d4c85693f722e60cf216cff61d9e8b0
size_bytes: 21755
fetched_at: '2026-07-02'
storage:
r2:
provider: r2
bucket: ledger-raw
key: raw/ici/ici-fact-book-table-30/2026/bd15d5fc983e55632bbe3f884f9c826f6d4c85693f722e60cf216cff61d9e8b0/26-fb-table-30.xlsx
uri: r2://ledger-raw/raw/ici/ici-fact-book-table-30/2026/bd15d5fc983e55632bbe3f884f9c826f6d4c85693f722e60cf216cff61d9e8b0/26-fb-table-30.xlsx
3 changes: 2 additions & 1 deletion ledger/source_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"bea-regional-state-personal-income-components-2024": Path(
"bea/regional_personal_income_state"
),
"ici-fact-book-table-30": Path("ici/fact_book_table_30"),
"statbel-population-structure-2026": Path("statbel/population_structure_2026"),
"statbel-fiscal-income-2023-nis-2025": Path(
"statbel/fiscal_income_2023_nis_2025"
Expand Down Expand Up @@ -2044,4 +2045,4 @@ def _scaffold_template(
concept: TODO_concept
unit: count
aggregation: sum
"""
"""
261 changes: 261 additions & 0 deletions packages/ici/fact_book_table_30/source_package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
schema_version: ledger.source_package.v1
package_id: ici-fact-book-table-30
label: ICI Fact Book Table 30 mutual fund capital gains distributions
artifact:
source_name: ici
source_table: 2026 Investment Company Fact Book Data Table 30, Long-Term Mutual Funds Paid and Reinvested Capital Gains by Type of Fund
resource_package: db
resource_directory: data/ici/fact_book_table_30
manifest: manifest.yaml
vintage: calendar_year_{year}
extracted_at: "2026-07-02"
extraction_method: xlsx whole-workbook used-range cell parse
parser: xlsx_used_range
artifact_year: 2026
record_sets:
- record_set_id: ici.cy2015.fact_book_table_30
record_set_spec_id: ici.fact_book_table_30.paid_reinvested.v1
source_record_id_prefix: ici.cy2015.fact_book_table_30
sheet_name: final
period_type: calendar_year
period: "2015"
geography_id: 0100000US
geography_level: country
geography_name: United States
geography_vintage: current
entity: institutional_sector
entity_role: long_term_mutual_funds
domain: mutual_fund_capital_gains_distributions
groupby_dimension: ici.distribution_disposition
rows:
- value_id: year_2015
label: "2015"
ordinal: 0
row_number: 41
expected_row_header_column: A
expected_row_header: 2015
table_record_kind: total
measures:
- measure_id: paid_total
label: Paid capital gains, total
ordinal: 0
column: B
concept: ici.mutual_fund_capital_gains_paid
unit: usd
aggregation: sum
source_concept: ici.mutual_fund_capital_gains_paid
concept_relation: exact
concept_authority: ledger-us
concept_evidence_url: https://www.icifactbook.org/26-fb-data-tables.html
concept_evidence_notes: >
ICI Fact Book Table 30 total capital gains paid by long-term
mutual funds. Includes short-term and long-term capital gains
distributions and all account types (taxable and tax-deferred);
funds investing primarily in other mutual funds are excluded.
Year-level anchor for the populace capital gain distributions
imputation and the GROWTH Act (H.R. 2089 / S. 1839) analysis.
legal_vintage: calendar_year_2015
value_scale: 1000000
- measure_id: reinvested_total
label: Reinvested capital gains, total
ordinal: 1
column: G
concept: ici.mutual_fund_capital_gains_reinvested
unit: usd
aggregation: sum
value_scale: 1000000
- record_set_id: ici.cy2021.fact_book_table_30
record_set_spec_id: ici.fact_book_table_30.paid_reinvested.v1
source_record_id_prefix: ici.cy2021.fact_book_table_30
sheet_name: final
period_type: calendar_year
period: "2021"
geography_id: 0100000US
geography_level: country
geography_name: United States
geography_vintage: current
entity: institutional_sector
entity_role: long_term_mutual_funds
domain: mutual_fund_capital_gains_distributions
groupby_dimension: ici.distribution_disposition
rows:
- value_id: year_2021
label: "2021"
ordinal: 0
row_number: 47
expected_row_header_column: A
expected_row_header: 2021
table_record_kind: total
measures:
- measure_id: paid_total
label: Paid capital gains, total
ordinal: 0
column: B
concept: ici.mutual_fund_capital_gains_paid
unit: usd
aggregation: sum
value_scale: 1000000
- measure_id: reinvested_total
label: Reinvested capital gains, total
ordinal: 1
column: G
concept: ici.mutual_fund_capital_gains_reinvested
unit: usd
aggregation: sum
value_scale: 1000000
- record_set_id: ici.cy2022.fact_book_table_30
record_set_spec_id: ici.fact_book_table_30.paid_reinvested.v1
source_record_id_prefix: ici.cy2022.fact_book_table_30
sheet_name: final
period_type: calendar_year
period: "2022"
geography_id: 0100000US
geography_level: country
geography_name: United States
geography_vintage: current
entity: institutional_sector
entity_role: long_term_mutual_funds
domain: mutual_fund_capital_gains_distributions
groupby_dimension: ici.distribution_disposition
rows:
- value_id: year_2022
label: "2022"
ordinal: 0
row_number: 48
expected_row_header_column: A
expected_row_header: 2022
table_record_kind: total
measures:
- measure_id: paid_total
label: Paid capital gains, total
ordinal: 0
column: B
concept: ici.mutual_fund_capital_gains_paid
unit: usd
aggregation: sum
value_scale: 1000000
- measure_id: reinvested_total
label: Reinvested capital gains, total
ordinal: 1
column: G
concept: ici.mutual_fund_capital_gains_reinvested
unit: usd
aggregation: sum
value_scale: 1000000
- record_set_id: ici.cy2023.fact_book_table_30
record_set_spec_id: ici.fact_book_table_30.paid_reinvested.v1
source_record_id_prefix: ici.cy2023.fact_book_table_30
sheet_name: final
period_type: calendar_year
period: "2023"
geography_id: 0100000US
geography_level: country
geography_name: United States
geography_vintage: current
entity: institutional_sector
entity_role: long_term_mutual_funds
domain: mutual_fund_capital_gains_distributions
groupby_dimension: ici.distribution_disposition
rows:
- value_id: year_2023
label: "2023"
ordinal: 0
row_number: 49
expected_row_header_column: A
expected_row_header: 2023
table_record_kind: total
measures:
- measure_id: paid_total
label: Paid capital gains, total
ordinal: 0
column: B
concept: ici.mutual_fund_capital_gains_paid
unit: usd
aggregation: sum
value_scale: 1000000
- measure_id: reinvested_total
label: Reinvested capital gains, total
ordinal: 1
column: G
concept: ici.mutual_fund_capital_gains_reinvested
unit: usd
aggregation: sum
value_scale: 1000000
- record_set_id: ici.cy2024.fact_book_table_30
record_set_spec_id: ici.fact_book_table_30.paid_reinvested.v1
source_record_id_prefix: ici.cy2024.fact_book_table_30
sheet_name: final
period_type: calendar_year
period: "2024"
geography_id: 0100000US
geography_level: country
geography_name: United States
geography_vintage: current
entity: institutional_sector
entity_role: long_term_mutual_funds
domain: mutual_fund_capital_gains_distributions
groupby_dimension: ici.distribution_disposition
rows:
- value_id: year_2024
label: "2024"
ordinal: 0
row_number: 50
expected_row_header_column: A
expected_row_header: 2024
table_record_kind: total
measures:
- measure_id: paid_total
label: Paid capital gains, total
ordinal: 0
column: B
concept: ici.mutual_fund_capital_gains_paid
unit: usd
aggregation: sum
value_scale: 1000000
- measure_id: reinvested_total
label: Reinvested capital gains, total
ordinal: 1
column: G
concept: ici.mutual_fund_capital_gains_reinvested
unit: usd
aggregation: sum
value_scale: 1000000
- record_set_id: ici.cy2025.fact_book_table_30
record_set_spec_id: ici.fact_book_table_30.paid_reinvested.v1
source_record_id_prefix: ici.cy2025.fact_book_table_30
sheet_name: final
period_type: calendar_year
period: "2025"
geography_id: 0100000US
geography_level: country
geography_name: United States
geography_vintage: current
entity: institutional_sector
entity_role: long_term_mutual_funds
domain: mutual_fund_capital_gains_distributions
groupby_dimension: ici.distribution_disposition
rows:
- value_id: year_2025
label: "2025"
ordinal: 0
row_number: 51
expected_row_header_column: A
expected_row_header: 2025
table_record_kind: total
measures:
- measure_id: paid_total
label: Paid capital gains, total
ordinal: 0
column: B
concept: ici.mutual_fund_capital_gains_paid
unit: usd
aggregation: sum
value_scale: 1000000
- measure_id: reinvested_total
label: Reinvested capital gains, total
ordinal: 1
column: G
concept: ici.mutual_fund_capital_gains_reinvested
unit: usd
aggregation: sum
value_scale: 1000000
31 changes: 17 additions & 14 deletions tests/test_ledger_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ def test_build_bundle_writes_merged_consumer_contract(tmp_path):
"aggregate_duplicate_key_count": 0,
"entity_count": 8,
"error_count": 0,
"fact_count": 38959,
"fact_count": 38971,
"geography_count": 1053,
"period_count": 14,
"period_count": 16,
"semantic_duplicate_key_count": 12,
"skipped_source_count": 9,
"source_count": 28,
"source_package_count": 57,
"source_count": 29,
"source_package_count": 58,
"warning_count": 1,
}
assert len(rows) == 38959
assert len(rows) == 38971
assert rows[0]["aggregate_fact_key"].startswith("ledger.aggregate_fact.v2:")
assert rows[0]["semantic_fact_key"].startswith("ledger.semantic_fact.v2:")
assert source_packages["source_package_count"] == 57
assert source_packages["source_package_count"] == 58
assert source_packages["skipped_source_count"] == 9
assert sorted(item["source"] for item in source_packages["skipped_sources"]) == [
"census-acs-s0101-congressional-district-age-2024",
Expand All @@ -52,7 +52,7 @@ def test_build_bundle_writes_merged_consumer_contract(tmp_path):
"cms-aca-oep-state-level-2025",
"jct-tax-expenditures-2024",
]
assert coverage["fact_count"] == 38959
assert coverage["fact_count"] == 38971
assert coverage["counts"]["by_source"] == {
"bea": 445,
"bfp_economic_outlook": 5,
Expand All @@ -67,6 +67,7 @@ def test_build_bundle_writes_merged_consumer_contract(tmp_path):
"federal_reserve": 1,
"hhs_acf_liheap": 2,
"hhs_acf_tanf": 110,
"ici": 12,
"hmrc": 193,
"irs_soi": 33535,
"jrc_euromod_be": 18,
Expand All @@ -84,7 +85,7 @@ def test_build_bundle_writes_merged_consumer_contract(tmp_path):
"usda_snap": 216,
}
table_counts = coverage["counts"]["by_source_table"]
assert len(table_counts) == 52
assert len(table_counts) == 53
assert table_counts["irs_soi:Congressional District Data 2022"] == 26880
assert table_counts["irs_soi:Publication 1304 Table 1.1"] == 80
assert (
Expand Down Expand Up @@ -196,11 +197,13 @@ def test_build_bundle_writes_merged_consumer_contract(tmp_path):
== 18
)
assert coverage["counts"]["by_period"] == {
"calendar_year:2015": 2,
"calendar_year:2018": 1,
"calendar_year:2022": 6,
"calendar_year:2023": 1011,
"calendar_year:2024": 1467,
"calendar_year:2025": 1261,
"calendar_year:2021": 2,
"calendar_year:2022": 8,
"calendar_year:2023": 1013,
"calendar_year:2024": 1469,
"calendar_year:2025": 1263,
"calendar_year:2026": 21,
"calendar_year:2031": 2,
"fiscal_year:2023": 48,
Expand All @@ -216,7 +219,7 @@ def test_build_bundle_writes_merged_consumer_contract(tmp_path):
assert coverage["counts"]["by_geography"]["nuts1:BE2"] == 17
assert coverage["counts"]["by_geography"]["nuts1:BE3"] == 6
assert coverage["counts"]["by_geography"]["commune:11002"] == 1
assert coverage["counts"]["by_geography"]["country:0100000US"] == 1849
assert coverage["counts"]["by_geography"]["country:0100000US"] == 1861
assert coverage["counts"]["by_geography"]["state:0400000US06"] == 217
assert (
coverage["counts"]["by_geography"]["congressional_district:5001700US0601"] == 56
Expand All @@ -228,7 +231,7 @@ def test_build_bundle_writes_merged_consumer_contract(tmp_path):
"firm": 1439,
"government": 125,
"household": 62,
"institutional_sector": 1,
"institutional_sector": 13,
"pension_plan": 2,
"person": 3682,
"tax_unit": 33541,
Expand Down
Loading