babylon.data.schema

SQLite schema for external reality data.

These tables store ground-truth data from Census, FRED, BLS, etc. This is the material base that constrains the simulation.

Tables:
Geographic Reference:
  • states: US state FIPS codes and names

  • metro_areas: Metropolitan Statistical Areas (CBSA codes)

Census Data:
  • census_population: State-level population and class proxies

  • census_metro: Metro-level demographics

Economic Data:
  • fred_indicators: Federal Reserve economic indicators

Labor Data:
  • union_membership: Union membership by state

Resource Data:
  • strategic_resources: Strategic resource stockpiles and production

Classes

CensusMetro(**kwargs)

Metro-level demographics from Census ACS.

CensusPopulation(**kwargs)

State-level population and class proxies from Census ACS.

FredIndicator(**kwargs)

Federal Reserve economic indicators.

MetroArea(**kwargs)

Metropolitan Statistical Areas.

State(**kwargs)

US States - reference table.

StrategicResource(**kwargs)

Strategic resource stockpiles and production.

UnionMembership(**kwargs)

Union membership by state from BLS.

class babylon.data.schema.State(**kwargs)[source]

Bases: Base

US States - reference table.

fips: Mapped[str]
name: Mapped[str]
abbreviation: Mapped[str]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class babylon.data.schema.MetroArea(**kwargs)[source]

Bases: Base

Metropolitan Statistical Areas.

cbsa_code: Mapped[str]
name: Mapped[str]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class babylon.data.schema.CensusPopulation(**kwargs)[source]

Bases: Base

State-level population and class proxies from Census ACS.

id: Mapped[int]
state_fips: Mapped[str | None]
year: Mapped[int]
total_pop: Mapped[int | None]
employed: Mapped[int | None]
unemployed: Mapped[int | None]
self_employed: Mapped[int | None]
median_income: Mapped[float | None]
poverty_pop: Mapped[int | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class babylon.data.schema.CensusMetro(**kwargs)[source]

Bases: Base

Metro-level demographics from Census ACS.

id: Mapped[int]
cbsa_code: Mapped[str | None]
year: Mapped[int]
total_pop: Mapped[int | None]
median_income: Mapped[float | None]
gini_index: Mapped[float | None]
median_rent: Mapped[float | None]
median_home_value: Mapped[float | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class babylon.data.schema.FredIndicator(**kwargs)[source]

Bases: Base

Federal Reserve economic indicators.

id: Mapped[int]
year: Mapped[int]
quarter: Mapped[int | None]
gdp_billions: Mapped[float | None]
unemployment_pct: Mapped[float | None]
cpi: Mapped[float | None]
fed_funds_rate: Mapped[float | None]
federal_debt_millions: Mapped[float | None]
m2_money_supply: Mapped[float | None]
median_income: Mapped[float | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class babylon.data.schema.UnionMembership(**kwargs)[source]

Bases: Base

Union membership by state from BLS.

id: Mapped[int]
state_fips: Mapped[str | None]
year: Mapped[int]
total_employed: Mapped[int | None]
union_members: Mapped[int | None]
union_pct: Mapped[float | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class babylon.data.schema.StrategicResource(**kwargs)[source]

Bases: Base

Strategic resource stockpiles and production.

id: Mapped[int]
resource_id: Mapped[str]
resource_name: Mapped[str]
year: Mapped[int]
annual_production: Mapped[float | None]
production_unit: Mapped[str | None]
strategic_reserve: Mapped[float | None]
reserve_unit: Mapped[str | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.