API

class eu5.Age(slug: str)
property index: int
classmethod last() Age
class eu5.Building(*, building_id: int | None = None, data: dict[str, Any] | None = None, save: Save)
property base_cost: float
property can_add_level: bool
property employment: float

Percentage of workers over the total required by the current level.

property level: int
property location: Location
property max_level: int
property methods: dict[str, ProductionMethod]
property name: str
property pop_type: str
predict_income_delta(level_delta: int = 1, method_ids: set[str] | None = None) float

Predicts the effects of building a level of this location building.

The prediction accounts for effects in the entire market of the changes in supply and demand that constructing a level would cause.

The prediction is based on rest values of market goods (i.e. Target Price rather than Price).

property slug: str
property template: BuildingTemplate
class eu5.BuildingConstruction(save: Save, data: dict[str, Any])
class eu5.BuildingTemplate(slug: 'str', category: 'str | None', pop_type: 'str', build_time: 'str | None', employment_size: 'float', expensive: 'bool', increase_per_level_cost: 'float | None', allow: 'dict[str, Any]', construction_demand: 'str | None', modifiers: 'Mapping[str, float]', min_age: 'int', method_groups: 'tuple[set[str], ...]', methods: 'dict[str, ProductionMethod]', supports_country: 'Callable[[Country], bool]', supports_location: 'Callable[[Location], bool]', get_max_level: 'Callable[[Location], int]', estate: 'str | None')
property advance: str | None
property base_cost: float
classmethod from_data(data: dict[str, Any], building_type: str, min_age: int) BuildingTemplate
classmethod from_slug(building_id: str) BuildingTemplate
get_method_efficiency_at(location: Location) dict[str, float]
property name: str
slug: str
category: str | None
pop_type: str
build_time: str | None
employment_size: float
expensive: bool
increase_per_level_cost: float | None
allow: dict[str, Any]
construction_demand: str | None
modifiers: Mapping[str, float]
min_age: int
method_groups: tuple[set[str], ...]
methods: dict[str, ProductionMethod]
supports_country: Callable[[Country], bool]
supports_location: Callable[[Location], bool]
get_max_level: Callable[[Location], int]
estate: str | None
class eu5.Character(character_id: 'int', data: 'dict[str, Any]', save: 'Save')
property adm: int
property dip: int
property mil: int
class eu5.Construction(save: Save, data: dict[str, Any])
classmethod from_save(save: Save, data: dict[str, Any]) Construction
class eu5.Country(country_id: int, is_great_power: bool, data: dict[str, Any], save: Save)
property accepted_cultures: dict[int, Culture]
property advances: set[str]
property capital: Location
property court_language: Language
property estates: dict[str, Estate]
property expected_army_size: int
property expected_navy_size: int
property gold: float
property government_type: str
property institutions: set[str]
property laws: dict[str, str]
property liturgical_language: Language
property locations: dict[int, Location]
property markets: dict[int, Market]
property monthly_income: float
property name: str
property population: float

1.0 represents 1 000 people.

property prestige: float
property primary_culture: Culture
property primary_religion: Religion
property privileges: set[str]
property provinces: dict[int, Province]
property reforms: set[str]
property ruler: Character
property societal_values: SocietalValues
property stability: float
property tax_rates: dict[str, float]
property tolerated_cultures: dict[int, Culture]
class eu5.Culture(culture_id: int, data: dict[str, Any], save: Save)
class eu5.Date(year: int, month: int, day: int)
classmethod from_string(date: str) Date
class eu5.Estate(estate_id: int, data: dict[str, Any], save: Save)
property country: Country
property satisfaction: float
property type: str
class eu5.Good(id: 'str', base_price: 'float', method: 'str | None', category: 'str | None')
classmethod from_id(good_id: str) Good
property name: str
id: str
base_price: float
method: str | None
category: str | None
class eu5.HolySite(site_id: int, data: dict[str, Any], save: Save)
class eu5.Language(slug: str, power: float, save: Save)
property parent: Language | None
class eu5.Location(location_id: int, data: dict[str, Any], save: Save)
average_literacy(pop_type: str) float

Calculate the average literacy for pops of a given type.

Args:

pop_type: The pop type to filter by (e.g., “laborers”, “clergy”, “nobles”, “peasants”)

Returns:

The weighted average literacy, or None if no pops of that type exist or pops is not available.

property building_cost_multiplier: float
property buildings: dict[str, Building]
property buildings_by_name: dict[str, Building]
property constructions: dict[int, Construction]
property control: float
property development: float
property estate_tax: dict[str, float]

Dictionary mapping estate names (e.g., “nobles”, “clergy”, “burghers”, “peasants”) to their tax contribution value.

property good: MarketGood | None
property has_river: bool
property income: float
property is_capital: bool
property is_coastal: bool
property market: Market | None
property market_access: float
property name: str
property owner: Country | None
property population: float
property potential_tax_base: float
predict_income(control_delta: float) float

Return the expected income resulting from a change in control.

For example, to simulate constructing a Temple, set control_delta to 0.05 (5%).

property province: Province
property proximity: float
property rank: str
property rgo: Rgo | None
property slug: str
property tax_base: float
property tax_cut: float

Share of a location’s tax base that reaches the crown.

property vegetation: str | None
class eu5.Market(market_id: int, data: dict[str, Any], save: Save)
property center: Location
property goods: dict[str, MarketGood]
property locations: dict[int, Location]
property name: str
class eu5.MarketGood(good_id: str, data: dict[str, Any], save: Save, market: Market)
property demand: float
property effective_demand: float
property effective_supply: float
get_target_price(*, effective_supply: float, effective_demand: float) float
property good: Good
property name: str
property price: float
property supply: float
property target_price: float
good_id: str
class eu5.Pop(pop_id: int, data: dict[str, Any], save: Save)
property culture: Culture
property literacy: float
property religion: Religion
property satisfaction: float
property size: float
property type: float
class eu5.PotentialBuilding(*, building_slug: str, save: Save, location: Location)

Building that can be built at a specific location, but has not been built yet (so building ID is always).

property employment: float

Percentage of workers over the total required by the current level.

property location: Location
property slug: str
class eu5.Production(supply: float = 0.0, demand: float = 0.0)
demand: float = 0.0
supply: float = 0.0
class eu5.ProductionMethod(id: 'str', produced_good: 'str | None', output: 'float', inputs: 'Mapping[str, float]', category: 'str | None')
classmethod from_data(method_id: str, payload: Mapping[str, object]) ProductionMethod
id: str
produced_good: str | None
output: float
inputs: Mapping[str, float]
category: str | None
class eu5.Province(province_id: int, data: dict[str, Any], save: Save)
property capital: Location
property goods: dict[str, Good]
property locations: dict[int, Location]
property owner: Country
property slug: str
class eu5.Religion(religion_id: int, data: dict[str, Any], save: Save)
property group: str
class eu5.Rgo(location: Location, data: dict[str, Any])
property income_multiplier: float
property level_cost: float

Calculate the cost to build one more RGO level.

The cost is based on lumber price (or tools price for lumber RGOs) in the location’s market, with a base cost of 50 ducats.

Formula: - If current_price == base_price: return 50 - If current_price > base_price: return 50 * (1 + (current_price / base_price - 1) / 3), truncated to 4 decimals - Otherwise: return min(50 * (1 + (base_price - current_price_truncated_to_3_decimals) * 3), 33.5)

property level_income: float
property output_multiplier: float
property output_per_level: float
class eu5.RgoConstruction(save: Save, data: dict[str, Any])
class eu5.Road(from_: Location, to: Location, road_type: str)
target_from(location: Location) Location
class eu5.Save(save_path: str)
property age: Age
property buildings: dict[int, Building]
property buildings_per_location: dict[int, dict[int, Building]]
property characters: dict[int, Character]
property constructions: dict[int, Construction]
property constructions_by_location: dict[int, dict[int, Construction]]
property countries: dict[int, Country]
property cultures: dict[int, Culture]
property estates: dict[int, Estate]
property game_date: Date
property holy_sites: dict[int, HolySite]
property languages: dict[str, Language]
property last_modified: datetime
classmethod latest() Save
location_slug_from_id(location_id: int) str
property locations: dict[int, Location]
property locations_by_market: dict[int, dict[int, Location]]
property locations_by_name: dict[str, Location]
property locations_by_province: dict[int, dict[int, Location]]
property locations_by_slug: dict[str, Location]
property markets: dict[int, Market]
property name: str
property played_country: Country
property pops: dict[int, Pop]
property provinces: dict[int, Province]
property provinces_by_location: dict[int, Province]
property provinces_by_slug: dict[str, Province]
property religions: dict[int, Religion]
property roads: dict[int, list[Road]]
class eu5.SocietalValues(data: dict[str, float])